Added == operator for comparing two Object IDs
This commit is contained in:
parent
7ff87df56c
commit
bd12b7de96
1 changed files with 4 additions and 0 deletions
|
|
@ -25,6 +25,10 @@ type
|
||||||
|
|
||||||
{.deprecated: [Toid: Oid].}
|
{.deprecated: [Toid: Oid].}
|
||||||
|
|
||||||
|
proc `==`*(oid1: Oid, oid2: Oid): bool =
|
||||||
|
## Compare two Mongo Object IDs for equality
|
||||||
|
return (oid1.time == oid2.time) and (oid1.fuzz == oid2.fuzz) and (oid1.count == oid2.count)
|
||||||
|
|
||||||
proc hexbyte*(hex: char): int =
|
proc hexbyte*(hex: char): int =
|
||||||
case hex
|
case hex
|
||||||
of '0'..'9': result = (ord(hex) - ord('0'))
|
of '0'..'9': result = (ord(hex) - ord('0'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue