/* returns the index for 'key' if 'key' is an appropriate key to live in the array part of the table, 0 otherwise.  */
static unsigned int arrayindex(const TValue *key)
/* returns the index for 'key' if 'key' is an appropriate key to live in the array part of the table, 0 otherwise.  */
static unsigned int arrayindex(const TValue *key)
{
    lua_Integer k = ivalue(key);
    if (0 < k && (lua_Unsigned)k <= MAXASIZE)
      return cast(unsigned int, k);
  }
  return 0;
}