fixes #2395
This commit is contained in:
parent
a30becf1b5
commit
5d132b75ef
1 changed files with 4 additions and 6 deletions
|
|
@ -1714,12 +1714,10 @@ iterator items*[T](a: set[T]): T {.inline.} =
|
|||
## iterates over each element of `a`. `items` iterates only over the
|
||||
## elements that are really in the set (and not over the ones the set is
|
||||
## able to hold).
|
||||
var i = low(T)
|
||||
if i <= high(T):
|
||||
while true:
|
||||
if i in a: yield i
|
||||
if i >= high(T): break
|
||||
inc(i)
|
||||
var i = low(T).int
|
||||
while i <= high(T).int:
|
||||
if T(i) in a: yield T(i)
|
||||
inc(i)
|
||||
|
||||
iterator items*(a: cstring): char {.inline.} =
|
||||
## iterates over each item of `a`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue