ソースを参照

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

読み込み中…
キャンセル
保存