summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/pure/collections/sets.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim
index 3e462f73f..33fec1a18 100644
--- a/lib/pure/collections/sets.nim
+++ b/lib/pure/collections/sets.nim
@@ -246,8 +246,9 @@ proc incl*[A](s: var HashSet[A], other: HashSet[A]) =
   for item in other: incl(s, item)
 
 template doWhile(a: expr, b: stmt): stmt =
-  b
-  while a: b
+  while true:
+    b
+    if not a: break
 
 proc excl*[A](s: var HashSet[A], key: A) =
   ## Excludes `key` from the set `s`.