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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Yjc0NjEyODg0MmY0ODA0NDA4M2I1MWQ2MTU3YTJhMDEzZmQ2MGYxOA==
4
+ MTliMjJhMjVlMDc0ZWY2MTA2MTQwMzY1NjhhNzkzMzQyZjg3MDFlZg==
5
5
  data.tar.gz: !binary |-
6
- YTYzOTAwNTc2NDI3MDg2ODhhZTIzNWJjZjhhODczZmMyZDgwM2I5OQ==
6
+ MzUzYmM0MDE0MWJiNjRmN2E4NTlhMzMwYmViZjk1NTEyMjk5ODcwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YThjMDgwYjkzOWI0OTBjYjZlNDgzZGQ1Yjk2ZmFjMjk0MmVkMzc4NGFlN2Jj
10
- OWU2Mzc3MjU5MGY5ODBhNzc1OTA5ZDQ4NGM2ZGFhM2E3MmZiNDA3ZWY3ZGE2
11
- ZTliZGYwMzc5OTFmN2RkNTc0MzIyYjA4NGE0ZjRkMWExM2MzZTg=
9
+ MDkyYjIzZTlhYjYxMTAwN2M1NWU1NWVjMTFkYWQ4MTM0ZWQ4N2NhYWU0Mzdm
10
+ ZGE3YWMyYWY5YTk4ZmIyY2I3MjU2ZThhOWE2N2JjZjU5OTZmNjVlMjMzZGVh
11
+ NzE3MWVlZmMyNzBlMjgxMjFjOTU5Mjc3ODgxYzJiZDYyMTQyMGQ=
12
12
  data.tar.gz: !binary |-
13
- ZGUxZDg4Y2ZmZWQ3MjczM2RiYWUyNmNhYWQwY2MxMWZhYzQzOTk4M2NjNGIz
14
- MzFjMTZiZDc4NWFiZmE3YzgxZTE2Nzk2OGFjNmM5ZGRlNTNjNmRmZmZhYzIy
15
- OWI1OGU3ZmJkNGRlMmMyMTUzYjkyYjJhMTJjNjEzNmZjMDI5MDM=
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
- loop do
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
- if has_next(current_enumerator)
64
- y << current_enumerator.next
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totally_lazy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.49
4
+ version: 0.1.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raymond Barlow