Quote a keys for CritBitTree $ impl. Fixes #7987
This commit is contained in:
parent
e06f5bc3d0
commit
aa7348b356
1 changed files with 8 additions and 4 deletions
|
|
@ -322,10 +322,14 @@ proc `$`*[T](c: CritBitTree[T]): string =
|
|||
const avgItemLen = 16
|
||||
result = newStringOfCap(c.count * avgItemLen)
|
||||
result.add("{")
|
||||
for key, val in pairs(c):
|
||||
if result.len > 1: result.add(", ")
|
||||
result.add($key)
|
||||
when T isnot void:
|
||||
when T is void:
|
||||
for key in keys(c):
|
||||
if result.len > 1: result.add(", ")
|
||||
result.addQuoted(key)
|
||||
else:
|
||||
for key, val in pairs(c):
|
||||
if result.len > 1: result.add(", ")
|
||||
result.addQuoted(key)
|
||||
result.add(": ")
|
||||
result.addQuoted(val)
|
||||
result.add("}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue