totally_lazy 0.1.49 → 0.1.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/totally_lazy/enumerators.rb +8 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTliMjJhMjVlMDc0ZWY2MTA2MTQwMzY1NjhhNzkzMzQyZjg3MDFlZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzUzYmM0MDE0MWJiNjRmN2E4NTlhMzMwYmViZjk1NTEyMjk5ODcwOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDkyYjIzZTlhYjYxMTAwN2M1NWU1NWVjMTFkYWQ4MTM0ZWQ4N2NhYWU0Mzdm
|
10
|
+
ZGE3YWMyYWY5YTk4ZmIyY2I3MjU2ZThhOWE2N2JjZjU5OTZmNjVlMjMzZGVh
|
11
|
+
NzE3MWVlZmMyNzBlMjgxMjFjOTU5Mjc3ODgxYzJiZDYyMTQyMGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmQxZTVlNzA2MWY5OTgyYThmYWQwYmIwZGJlNmM0YTg0MDhjNzEyMDJjNWY3
|
14
|
+
ODI1MWJhNDcxYjBlZDJiYmRkMzJkNjdhOWFlZmNmY2M5NTZjN2FiMzc3NGM2
|
15
|
+
OGNlNTUwNmE1MTM1Y2RjNmU1MmZmMWRjOThiNzFiYzIwMDZkZTk=
|
@@ -51,17 +51,18 @@ module Enumerators
|
|
51
51
|
Enumerator.new do |y|
|
52
52
|
current_enumerator = empty_enumerator
|
53
53
|
|
54
|
-
|
54
|
+
get_current_enumerator = ->() {
|
55
55
|
until has_next(current_enumerator)
|
56
|
-
unless has_next(enumerator)
|
57
|
-
current_enumerator = empty_enumerator
|
58
|
-
break
|
59
|
-
end
|
56
|
+
return empty_enumerator unless has_next(enumerator)
|
60
57
|
current_enumerator = enumerator.next.enumerator
|
61
58
|
end
|
59
|
+
current_enumerator
|
60
|
+
}
|
62
61
|
|
63
|
-
|
64
|
-
|
62
|
+
loop do
|
63
|
+
current = get_current_enumerator.()
|
64
|
+
if has_next(current)
|
65
|
+
y << current.next
|
65
66
|
else
|
66
67
|
raise StopIteration.new
|
67
68
|
end
|