[Github-comments] [geany/geany] New tagmanager query module (#1187)

Thomas Martitz notifications at xxxxx
Tue Aug 23 22:06:35 UTC 2016


> +
> +		if (match && q->type >= 0)
> +			match = tag->type & q->type;
> +
> +		/* Remove tag from the results. tags are unowned so removing is easy */
> +		if (!match)
> +			g_queue_unlink(&res, node);
> +	}
> +
> +	/* Convert GQueue to GPtrArray for sort, dedup and return */
> +	i = 0;
> +	ret = g_ptr_array_sized_new(g_queue_get_length(&res));
> +	foreach_list(node, res.head)
> +	{
> +		tag = (TMTag *) node->data;
> +		g_ptr_array_insert(ret, i++, tag);

Thanks, you are right. Somewhow I was thinking in the lines if GSList where the insertion poinst must be searched first. Yes, `g_ptr_array_add()` is fine, I'll use that.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1187/files/386006313a0b78c614bd1ac522ac121e093df58d#r75960624
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160823/cbc36ffd/attachment.html>


More information about the Github-comments mailing list