summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-07-15 19:48:35 +0000
committerDavid Robillard <d@drobilla.net>2014-07-15 19:48:35 +0000
commit46e5b520df7f08edb96fb29e3775bccf3205d8f7 (patch)
tree1dd78e4de36a8229f6fc74c71ebbd14111915564
parent996fa3452a544cb4750e00d7d1f52c3a48d439f9 (diff)
downloadsord-46e5b520df7f08edb96fb29e3775bccf3205d8f7.tar.gz
sord-46e5b520df7f08edb96fb29e3775bccf3205d8f7.tar.bz2
sord-46e5b520df7f08edb96fb29e3775bccf3205d8f7.zip
Fix iteration over an entire graph (* * * graph).
git-svn-id: http://svn.drobilla.net/sord/trunk@296 3d64ff67-21c5-427c-a301-fe4f08042e5a
-rw-r--r--NEWS3
-rw-r--r--src/sord.c16
2 files changed, 12 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index cc96616..7743a27 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
sord (0.12.1) unstable;
+ * Fix iteration over an entire graph (* * * graph)
* sordmm.hpp: Remove unused members
* Update to waf 1.7.11
- -- David Robillard <d@drobilla.net> Tue, 20 Aug 2013 11:33:58 -0400
+ -- David Robillard <d@drobilla.net> Tue, 15 Jul 2014 15:16:07 -0400
sord (0.12.0) stable;
diff --git a/src/sord.c b/src/sord.c
index e3623d7..59e25e9 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -570,8 +570,14 @@ sord_best_index(SordModel* sord,
*n_prefix = 0;
switch (sig) {
case 0x000:
- *mode = ALL;
- return graph_search ? DEFAULT_GRAPH_ORDER : DEFAULT_ORDER;
+ if (graph_search) {
+ *mode = RANGE;
+ *n_prefix = 1;
+ return DEFAULT_GRAPH_ORDER;
+ } else {
+ *mode = ALL;
+ return DEFAULT_ORDER;
+ }
case 0x111:
*mode = SINGLE;
return graph_search ? DEFAULT_GRAPH_ORDER : DEFAULT_ORDER;
@@ -809,10 +815,8 @@ sord_find(SordModel* sord, const SordQuad pat)
int n_prefix;
const SordOrder index_order = sord_best_index(sord, pat, &mode, &n_prefix);
- SORD_FIND_LOG("Find " TUP_FMT " index=%s mode=%d"
- " n_prefix=%d ordering=%d%d%d%d\n",
- TUP_FMT_ARGS(pat), order_names[index_order], mode, n_prefix,
- ordering[0], ordering[1], ordering[2], ordering[3]);
+ SORD_FIND_LOG("Find " TUP_FMT " index=%s mode=%d n_prefix=%d\n",
+ TUP_FMT_ARGS(pat), order_names[index_order], mode, n_prefix);
if (pat[0] && pat[1] && pat[2] && pat[3])
mode = SINGLE; // No duplicate quads (Sord is a set)