mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Address Ameba issue
This commit is contained in:
parent
94d5c96e7d
commit
38ea2e7f96
1 changed files with 10 additions and 15 deletions
|
@ -18,10 +18,9 @@ module Spectator
|
|||
# Retrieves the next `Node`.
|
||||
# If there are none left, then `Iterator::Stop` is returned.
|
||||
def next
|
||||
# Keep going until either:
|
||||
# a. a node is found.
|
||||
# b. the stack is empty.
|
||||
until @stack.empty?
|
||||
# Nothing left to iterate.
|
||||
return stop if @stack.empty?
|
||||
|
||||
# Retrieve the next node.
|
||||
node = @stack.pop
|
||||
|
||||
|
@ -32,11 +31,7 @@ module Spectator
|
|||
end
|
||||
|
||||
# Return the current node.
|
||||
return node
|
||||
end
|
||||
|
||||
# Nothing left to iterate.
|
||||
stop
|
||||
node
|
||||
end
|
||||
|
||||
# Restart the iterator at the beginning.
|
||||
|
|
Loading…
Reference in a new issue