null+****@clear*****
null+****@clear*****
2011年 11月 10日 (木) 14:55:07 JST
Susumu Yata 2011-11-10 05:55:07 +0000 (Thu, 10 Nov 2011)
New Revision: d704906d3ecac21ed75e3465565eef531b59da89
Log:
fix a bug of grn::dat::Trie::ith_key().
Modified files:
lib/dat/trie.hpp
Modified: lib/dat/trie.hpp (+3 -3)
===================================================================
--- lib/dat/trie.hpp 2011-11-10 05:54:33 +0000 (545bbc6)
+++ lib/dat/trie.hpp 2011-11-10 05:55:07 +0000 (b93b4df)
@@ -74,10 +74,10 @@ class Trie {
bool remove(UInt32 key_id) {
const Key &key = ith_key(key_id);
- if (key.id() == INVALID_KEY_ID) {
- return false;
+ if (key.is_valid()) {
+ return remove(key.ptr(), key.length());
}
- return remove(key.ptr(), key.length());
+ return false;
}
bool remove(const void *ptr, UInt32 length) {
return remove_key(static_cast<const UInt8 *>(ptr), length);