diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-09-16 15:02:52 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-09-16 15:02:52 +0200 |
commit | 5936379b292dec79efd3a1eaa7cafae4fc6d675a (patch) | |
tree | b85b4401618e61fe4a8513a2d0a911cdcf09927e | |
parent | 06bdf2c4f96a6324b3fe667cebb03d44cd100a73 (diff) |
Bug in mtrie fixed
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r-- | src/mtrie.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mtrie.cpp b/src/mtrie.cpp index fafac2d..bb20df8 100644 --- a/src/mtrie.cpp +++ b/src/mtrie.cpp @@ -228,14 +228,14 @@ void zmq::mtrie_t::match_helper (unsigned char *data_, size_t size_, // If there's one subnode (optimisation). if (count == 1) { - next.node->match (data_ + 1, size_ - 1, func_, arg_); + if (min == data_ [0]) + next.node->match_helper (data_ + 1, size_ - 1, func_, arg_); return; } // If there are multiple subnodes. - for (unsigned char c = 0; c != count; c++) { - if (next.table [c]) - next.table [c]->match (data_ + 1, size_ - 1, func_, arg_); - } + if (next.table [data_ [0] - min]) + next.table [data_ [0] - min]->match_helper (data_ + 1, size_ - 1, + func_, arg_); } |