mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-03 14:09:05 +00:00
remove unnecessay conds for nilable strings/seqs
This commit is contained in:
@@ -26,7 +26,7 @@ template tupleObjectDollar*[T: tuple | object](result: var string, x: T) =
|
||||
result.add(": ")
|
||||
count.inc
|
||||
when compiles($value):
|
||||
when value isnot string and value isnot seq and compiles(value.isNil):
|
||||
when compiles(value.isNil):
|
||||
if value.isNil: result.add "nil"
|
||||
else: result.addQuoted(value)
|
||||
else:
|
||||
|
||||
@@ -106,7 +106,7 @@ proc collectionToString[T](x: T, prefix, separator, suffix: string): string =
|
||||
else:
|
||||
result.add(separator)
|
||||
|
||||
when value isnot string and value isnot seq and compiles(value.isNil):
|
||||
when compiles(value.isNil):
|
||||
# this branch should not be necessary
|
||||
if value.isNil:
|
||||
result.add "nil"
|
||||
|
||||
Reference in New Issue
Block a user