浏览代码

query::KeyValueQuery: Use raw tags for dense nodes

Johannes Hofmann 7 年前
父节点
当前提交
3dbfa7769d
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7
    4
      src/query.rs

+ 7
- 4
src/query.rs 查看文件

154
         return false;
154
         return false;
155
     }
155
     }
156
 
156
 
157
-    fn dense_node_matches(&self, _bi: &Self::BI, dnode: &DenseNode) -> bool {
158
-        //TODO use raw tags
159
-        for (key, val) in dnode.tags() {
160
-            if key == self.key && val == self.value {
157
+    fn dense_node_matches(&self, bi: &Self::BI, dnode: &DenseNode) -> bool {
158
+        for (key, val) in dnode.raw_tags() {
159
+            if key >= 0 &&
160
+               val >= 0 &&
161
+               bi.0.binary_search(&(key as u32)).is_ok() &&
162
+               bi.1.binary_search(&(val as u32)).is_ok()
163
+            {
161
                 return true;
164
                 return true;
162
             }
165
             }
163
         }
166
         }