Skip to content

Commit

Permalink
no need to test for eos? all the time, just scan until we cannot scan…
Browse files Browse the repository at this point in the history
… anymore
  • Loading branch information
tenderlove committed Feb 22, 2012
1 parent 0a6483c commit a0df933
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/journey/gtg/simulator.rb
Expand Up @@ -20,8 +20,7 @@ def initialize transition_table
def simulate string def simulate string
input = StringScanner.new string input = StringScanner.new string
state = [0] state = [0]
until input.eos? while sym = input.scan(/[\/\.\?]|[^\/\.\?]+/)
sym = input.scan(/[\/\.\?]|[^\/\.\?]+/)
state = tt.move(state, sym) state = tt.move(state, sym)
end end


Expand Down

0 comments on commit a0df933

Please sign in to comment.