From 1f3ce26421f73916aa978c67ab90cdf68218120d Mon Sep 17 00:00:00 2001 From: Charles Blake Date: Sat, 7 Feb 2015 13:13:03 -0500 Subject: [PATCH] Address Andreas' complaint about code duplication. --- lib/pure/collections/sets.nim | 5 +++-- 1 file 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`.