Skip to content

Commit

Permalink
Check ints for the end of string before seperator
Browse files Browse the repository at this point in the history
  • Loading branch information
b0d0nne11 committed Mar 18, 2015
1 parent 85cf368 commit 4d8fee4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ func (s *intMatcher) match(iter *charIter) bool {
c, sep, ok := iter.next()
count++

// if it's the end of the string, it's a match
if !ok {
return true
}

// if the current character is not a number:
// - it's either a separator that means it's a match
// - it's some other character that means it's not a match
Expand All @@ -391,11 +396,6 @@ func (s *intMatcher) match(iter *charIter) bool {
return false
}
}

// if it's the end of the string, it's a match
if !ok {
return true
}
}
}

Expand Down

0 comments on commit 4d8fee4

Please sign in to comment.