This commit is contained in:
narimiran
2020-10-28 08:57:42 +01:00
committed by Andreas Rumpf
parent f8cac6bbbc
commit b13fb9ddb8
2 changed files with 8 additions and 0 deletions

View File

@@ -1619,6 +1619,8 @@ proc `==`*[A, B](s, t: OrderedTable[A, B]): bool =
if s.counter != t.counter:
return false
if s.counter == 0 and t.counter == 0:
return true
var ht = t.first
var hs = s.first
while ht >= 0 and hs >= 0:

View File

@@ -456,3 +456,9 @@ block testNonPowerOf2:
var b = initTable[int, int](9)
b[1] = 10
assert b[1] == 10
block emptyOrdered:
var t1: OrderedTable[int, string]
var t2: OrderedTable[int, string]
assert t1 == t2