[Github-comments] [geany/geany] Enable local variables for C/C++ and improve autocompletion (PR #3185)

Thomas Martitz notifications at github.com
Sun May 1 20:43:08 UTC 2022


@kugel- commented on this pull request.



> +		!(tag->type & tm_tag_local_var_t) &&
+		is_autocomplete_tag(tag, info);
+}
+
+
+static guint copy_tags(GPtrArray *dst, TMTag **src, guint src_len, GHashTable *name_table,
+	gint num, gboolean (*predicate) (TMTag *, CopyInfo *), CopyInfo *info)
+{
+	guint i;
+
+	g_return_val_if_fail(src && dst, 0);
+
+	for (i = 0; i < src_len && num > 0; i++)
+	{
+		TMTag *tag = *src;
+		if (predicate(tag, info) &&

Regardless of the order, IMO the call to `is_autocomplete_tag()` doesn't need to be duplicated in each predicate function but can be called in one place here, especially if the compiler whats to inline it.

Indirect calls aren't as free as direct calls but it lets not focus on that, I don't care much.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3185#discussion_r862519422
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3185/review/958628735 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220501/2e3375e4/attachment.htm>


More information about the Github-comments mailing list