summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2019-05-28 12:42:59 +0200
committerkrangelov <kr.angelov@gmail.com>2019-05-28 12:42:59 +0200
commitac039ec74fad8983e8826c5357f1a40d73a0970a (patch)
tree83189538896748f80345ff86e1fcc5878f9aa17f /src/runtime
parent9f0ea19a1ca7eba160746bdc91c55f7ae4c0b4fc (diff)
filter out empty cohorts
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/c/pgf/scanner.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/runtime/c/pgf/scanner.c b/src/runtime/c/pgf/scanner.c
index 71444ca25..cdbf56cc8 100644
--- a/src/runtime/c/pgf/scanner.c
+++ b/src/runtime/c/pgf/scanner.c
@@ -229,20 +229,20 @@ pgf_lookup_cohorts_helper(PgfCohortsState *state, PgfCohortSpot* spot,
if (min <= len-1)
pgf_lookup_cohorts_helper(state, spot, i, k-1, min, len-1);
- if (seq->idx != NULL) {
+ if (seq->idx != NULL && gu_buf_length(seq->idx) > 0) {
PgfCohortRange* range = gu_buf_insert(state->found, 0);
range->start = *spot;
range->end = current;
range->buf = seq->idx;
+ }
- while (*current.ptr != 0) {
- if (!skip_space(&current.ptr, &current.pos))
- break;
- }
-
- gu_buf_heap_push(state->spots, pgf_cohort_spot_order, &current);
+ while (*current.ptr != 0) {
+ if (!skip_space(&current.ptr, &current.pos))
+ break;
}
+ gu_buf_heap_push(state->spots, pgf_cohort_spot_order, &current);
+
if (len+1 <= max)
pgf_lookup_cohorts_helper(state, spot, k+1, j, len+1, max);