Normalise `KeyError` exception message (#119)

This commit is contained in:
Jordan Hrycaj 2022-06-16 16:19:53 +01:00 committed by GitHub
parent c2f0cbf0d9
commit b3ea2c6b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -380,14 +380,12 @@ proc delete*[K,V](rq: var KeyedQueue[K,V]; key: K):
## Delete the item with key `key` from the queue and returns the key-value
## item pair just deleted (if any).
if rq.tab.hasKey(key):
try:
noKeyError("delete"):
let kvp = KeyedQueuePair[K,V](
key: key,
data: rq.tab[key].data)
rq.deleteImpl(key)
return ok(kvp)
except KeyError:
raiseAssert "We've checked that the key is present above"
err()
proc del*[K,V](rq: var KeyedQueue[K,V]; key: K) =