浏览代码

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);

正在加载...
取消
保存