瀏覽代碼

Add map_isArray()

pull/21/head
mtardy 4 年之前
父節點
當前提交
e37f21854b
共有 1 個檔案被更改,包括 8 行新增0 行删除
  1. +8
    -0
      object.c

+ 8
- 0
object.c 查看文件

@ -323,6 +323,14 @@ bool map_hasIntegerKey(oop map, size_t index)
return index == getInteger(key);
}
bool map_isArray(oop map)
{
assert(is(Map, map));
size_t size= map_size(map);
if (size == 0) return true;
return map_hasIntegerKey(map, 0) && map_hasIntegerKey(map, size-1);
}
int oopcmp(oop a, oop b)
{
type_t ta = getType(a), tb = getType(b);

Loading…
取消
儲存