summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 263fd7b)
raw | patch | inline | side by side (parent: 263fd7b)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 11 Mar 2015 19:01:19 +0000 (20:01 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 11 Mar 2015 19:01:19 +0000 (20:01 +0100) |
src/core/store_expr.c | patch | blob | history |
diff --git a/src/core/store_expr.c b/src/core/store_expr.c
index d9f6e0462b65c39e5e67c4b787139507c3969e43..8fc063d11e64ca621fd2206ad9a46b242d36cc48 100644 (file)
--- a/src/core/store_expr.c
+++ b/src/core/store_expr.c
if (! iter)
return 0;
- if (iter->tree)
+ if (iter->tree) {
+ /* this function may be called before get_next,
+ * so we'll have to apply filters here as well */
+ if (iter->filter) {
+ sdb_store_obj_t *child;
+ while ((child = STORE_OBJ(sdb_avltree_iter_peek_next(iter->tree)))) {
+ if (sdb_store_matcher_matches(iter->filter, child, NULL))
+ break;
+ (void)sdb_avltree_iter_get_next(iter->tree);
+ }
+ }
+
return sdb_avltree_iter_has_next(iter->tree);
+ }
+
return iter->array_idx < iter->array.data.array.length;
} /* sdb_store_expr_iter_has_next */