diff options
-rw-r--r-- | lib/pure/collections/sets.nim | 2 | ||||
-rw-r--r-- | tests/gc/gctest.nim | 3 | ||||
-rw-r--r-- | tools/nimgrep.nim | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index 0ef91c3cc..31ca56963 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -654,7 +654,7 @@ proc isValid*[A](s: OrderedSet[A]): bool = ## proc saveTarotCards(cards: OrderedSet[int]) = ## assert cards.isValid, "Pass an initialized set!" ## # Do stuff here, may crash in release builds! - result = not s.data.isNil + result = s.data.len > 0 proc len*[A](s: OrderedSet[A]): int {.inline.} = ## Returns the number of keys in `s`. diff --git a/tests/gc/gctest.nim b/tests/gc/gctest.nim index 7f5260200..25d57ff0e 100644 --- a/tests/gc/gctest.nim +++ b/tests/gc/gctest.nim @@ -66,8 +66,7 @@ proc caseTree(lvl: int = 0): PCaseNode = proc finalizeNode(n: PNode) = assert(n != nil) write(stdout, "finalizing: ") - if isNil(n.data): writeLine(stdout, "nil!") - else: writeLine(stdout, "not nil") + writeLine(stdout, "not nil") var id: int = 1 diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim index 9cfd7a86f..8c6353e31 100644 --- a/tools/nimgrep.nim +++ b/tools/nimgrep.nim @@ -315,7 +315,7 @@ checkOptions({optFilenames, optReplace}, "filenames", "replace") if optStdin in options: pattern = ask("pattern [ENTER to exit]: ") - if isNil(pattern) or pattern.len == 0: quit(0) + if pattern.len == 0: quit(0) if optReplace in options: replacement = ask("replacement [supports $1, $# notations]: ") |