From 46e5b520df7f08edb96fb29e3775bccf3205d8f7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Jul 2014 19:48:35 +0000 Subject: Fix iteration over an entire graph (* * * graph). git-svn-id: http://svn.drobilla.net/sord/trunk@296 3d64ff67-21c5-427c-a301-fe4f08042e5a --- NEWS | 3 ++- src/sord.c | 16 ++++++++++------ 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 Tue, 20 Aug 2013 11:33:58 -0400 + -- David Robillard 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) -- cgit v1.2.1