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