@@ -268,7 +268,7 @@ def select(&block)
268268 return enum_for ( :select ) unless block_given?
269269 LazyList . new do
270270 list = self
271- while true
271+ loop do
272272 break list if list . empty?
273273 break Cons . new ( list . head , list . tail . select ( &block ) ) if yield ( list . head )
274274 list = list . tail
@@ -895,7 +895,7 @@ def indices(object = Undefined, i = 0, &block)
895895 return EmptyList if empty?
896896 LazyList . new do
897897 node = self
898- while true
898+ loop do
899899 break Cons . new ( i , node . tail . indices ( Undefined , i + 1 , &block ) ) if yield ( node . head )
900900 node = node . tail
901901 break EmptyList if node . empty?
@@ -1346,7 +1346,7 @@ def cached_size?
13461346 MUTEX = Mutex . new
13471347
13481348 def realize
1349- while true
1349+ loop do
13501350 # try to "claim" the right to run the block which realizes target
13511351 if @atomic . compare_and_set ( 0 , 1 ) # full memory barrier here
13521352 begin
@@ -1455,7 +1455,7 @@ def realize
14551455 mutex = @mutex
14561456 mutex && mutex . synchronize do
14571457 return if @head != Undefined # another thread got ahead of us
1458- while true
1458+ loop do
14591459 if !@buffer . empty?
14601460 @head = @buffer . shift
14611461 @tail = Partitioned . new ( @partitioner , @buffer , @mutex )
@@ -1516,7 +1516,7 @@ def realize
15161516 mutex = @mutex
15171517 mutex && mutex . synchronize do
15181518 return if @head != Undefined # another thread got ahead of us
1519- while true
1519+ loop do
15201520 if !@buffer . empty?
15211521 @head = @buffer . shift
15221522 @tail = Left . new ( @splitter , @buffer , @mutex )
0 commit comments