mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
Merge pull request #1289 from fowlmouth/patch-5
json.== handles nil now
This commit is contained in:
@@ -621,9 +621,13 @@ proc `%`*(elements: openArray[PJsonNode]): PJsonNode =
|
||||
|
||||
proc `==`* (a,b: PJsonNode): bool =
|
||||
## Check two nodes for equality
|
||||
if a.kind != b.kind: false
|
||||
if a.isNil:
|
||||
if b.isNil: return true
|
||||
return false
|
||||
elif b.isNil or a.kind != b.kind:
|
||||
return false
|
||||
else:
|
||||
case a.kind
|
||||
return case a.kind
|
||||
of JString:
|
||||
a.str == b.str
|
||||
of JInt:
|
||||
|
||||
Reference in New Issue
Block a user