We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e06f5bc commit aa7348bCopy full SHA for aa7348b
lib/pure/collections/critbits.nim
@@ -322,10 +322,14 @@ proc `$`*[T](c: CritBitTree[T]): string =
322
const avgItemLen = 16
323
result = newStringOfCap(c.count * avgItemLen)
324
result.add("{")
325
- for key, val in pairs(c):
326
- if result.len > 1: result.add(", ")
327
- result.add($key)
328
- when T isnot void:
+ when T is void:
+ for key in keys(c):
+ if result.len > 1: result.add(", ")
+ result.addQuoted(key)
329
+ else:
330
+ for key, val in pairs(c):
331
332
333
result.add(": ")
334
result.addQuoted(val)
335
result.add("}")
0 commit comments