Skip to content

Commit

Permalink
Merge pull request #55 from ihrwein/f/fix-logic-error
Browse files Browse the repository at this point in the history
patter: fix has_more_tokens()
  • Loading branch information
ihrwein committed Aug 19, 2015
2 parents b4b3bf7 + 25571f8 commit c231de5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/matcher/pattern/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Pattern {
}

pub fn has_more_tokens(&self) -> bool {
self.pattern.is_empty()
!self.pattern.is_empty()
}

pub fn pop_test_message(&mut self) -> Option<TestMessage> {
Expand Down
4 changes: 2 additions & 2 deletions src/matcher/trie/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct ParserTrie {
macro_rules! insert_recurse {
($node:expr, $pattern:expr) => {
{
if $pattern.has_more_tokens() {
if !$pattern.has_more_tokens() {
$node.set_pattern($pattern);
$node
} else {
Expand All @@ -27,7 +27,7 @@ impl ParserTrie {
}

pub fn insert(&mut self, pattern: Pattern) -> &mut TrieOperations {
if pattern.has_more_tokens() {
if !pattern.has_more_tokens() {
&mut self.root
} else {
ParserTrie::insert_pattern(&mut self.root, pattern)
Expand Down

0 comments on commit c231de5

Please sign in to comment.