Skip to content
Browse files

no need to test for eos? all the time, just scan until we cannot scan…

… anymore
  • Loading branch information...
1 parent bded059 commit 1b661c679e4cce5b4880b0a6650ed01a16a5a8cf @tenderlove tenderlove committed Feb 22, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/journey/gtg/simulator.rb
View
3 lib/journey/gtg/simulator.rb
@@ -20,8 +20,7 @@ def initialize transition_table
def simulate string
input = StringScanner.new string
state = [0]
- until input.eos?
- sym = input.scan(%r([/.?]|[^/.?]+))
+ while sym = input.scan(%r([/.?]|[^/.?]+))
state = tt.move(state, sym)
end

0 comments on commit 1b661c6

Please sign in to comment.
Something went wrong with that request. Please try again.