{
tags = tm_tags_find(q->workspace->tags_array, s->str, s->len, &ntags);
foreach_c_array(ptag, tags, ntags)
g_queue_insert_sorted(&res, *ptag, tag_compare_ptr, &sort_options);
}
- }
- /* Filter tags according to scope, type and lang. */
- for (node = res.head; node; node = next)
- {
gboolean match = TRUE;
next = node->next;
tag = node->data;
foreach_ptr_array(scope, i, q->scopes)
match = match && (g_strcmp0(tag->scope, scope) == 0);
as you seem worried about speed, better break out early when match becomes false, as it will just keep being false on and on