Skip to content

Commit 9d01732

Browse files
committed
prefer while loop
1 parent 88f7932 commit 9d01732

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

external_library/java/hype/hype_swarm.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ def draw
7474
)
7575
@count += 1
7676
end
77-
H.draw_stage
78-
begin
79-
it = swarm.goals.iterator
77+
H.draw_stage
78+
it = swarm.goals.iterator
79+
while it.has_next
8080
it.remove
8181
it.next
82-
end unless swarm.goals.iterator.has_next
82+
end
83+
8384
pool.each do |d|
8485
swarm.add_goal(d.x, d.y)
8586
end

0 commit comments

Comments
 (0)