[Github-comments] [geany/geany] Fix the symbols tree hierarchy when several tags have the same name (#1598)

Colomban Wendling notifications at xxxxx
Sat Sep 23 18:55:57 UTC 2017


b4n commented on this pull request.



>  	GTree *tree;
-	if (g_hash_table_lookup_extended(table, tag->name, NULL, (gpointer *) &tree) &&
-		! utils_str_equal(parent_name, tag->name) /* prevent Foo::Foo from making parent = child */)
+
+	if (EMPTY(tag->scope))
+	{
+		/* simple case, just use the tag name */
+		name = tag->name;

That was a vain attempt at over-optimization to avoid memory allocation in the simple case.  And it'd need profiling, but it might be worth it as it's likely to be the most common case (root scope symbol and no duplicate).  But if it just adds complexity for the reader I'll drop it.

-- 
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/1598#discussion_r140639530
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170923/359269d9/attachment.html>


More information about the Github-comments mailing list