@techee commented on this pull request.
In src/tagmanager/tm_workspace.c:
> - if (*header == NULL && g_strcmp0(hdr_comps[0], src_comps[0]) == 0) - *header = hdr; - g_hash_table_add(includes, hdr); - g_strfreev(hdr_comps); + for (j = 0; j < tm_files->len; j++) + { + TMSourceFile *hdr = tm_files->pdata[j]; + gchar **hdr_comps = g_strsplit(hdr->short_name, ".", 2); + + if (g_strcmp0(hdr_comps[0], src_comps[0]) == 0)
I'm not sure if I understand completely what you suggest but it's true we can return the GPtrArray directly and avoid creation of the list - I just made a new commit doing this. Is this what you had in mind?
Note that the inner loop should still be there as we should also use all the includes of the same name similarly to the header file.
Separating extraction of header candidates to a separate function would be possible but it will probably lead to a lot of duplicated code.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.