Propagating the del-returns-a-bool change through the trie DB code. (#578)

See here:
8f0ae55353
This commit is contained in:
Adam Spitz 2023-01-17 16:39:28 -05:00 committed by GitHub
parent 68f4c53828
commit 71b148a5b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ type
gcsafe, raises: [Defect].}
## The result will be empty seq if not found
DelProc = proc (db: RootRef, key: openArray[byte]) {.
DelProc = proc (db: RootRef, key: openArray[byte]): bool {.
gcsafe, raises: [Defect].}
ContainsProc = proc (db: RootRef, key: openArray[byte]): bool {.
@ -172,7 +172,7 @@ proc getImpl[T](db: RootRef, key: openArray[byte]): seq[byte] =
mixin get
return get(T(db), key)
proc delImpl[T](db: RootRef, key: openArray[byte]) =
proc delImpl[T](db: RootRef, key: openArray[byte]): bool =
mixin del
del(T(db), key)
@ -217,7 +217,7 @@ proc del*(db: TrieDatabaseRef, key: openArray[byte]) =
if t != nil:
t.modifications.del(key)
else:
db.delProc(db.obj, key)
discard db.delProc(db.obj, key)
proc contains*(db: TrieDatabaseRef, key: openArray[byte]): bool =
# TODO: This is quite inefficient and it won't be necessary once