[Github-comments] [geany/geany] Make geany -g tags output reproducible (#1989)

Colomban Wendling notifications at xxxxx
Wed Nov 7 21:21:05 UTC 2018


> So using inode as the hash is just a slow way of making a hash of a file path.

Well, the inode gets a goodish hash, but the equal check makes it worse than a string hash and comparison on the file path yeah.
If really the inode thing was useful, it should be used as the key directly rather than a bad convoluted hash that's guaranteed to have a worse `stat()` call count anyway.

> Yeah, since 2.40 `g_hash_table_insert()` returns if it inserted or not, so the filename could be added to the list on the fly.  But Glib 2.40 didn't exist back when this was originally written.

The code [already checks if the hash table contains the element before inserting it](https://github.com/geany/geany/blob/97547edb52e34b8f78f44a13548a0fb55baf1a44/src/tagmanager/tm_workspace.c#L534), so it should be OK no matter which version is used.

-- 
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/1989#issuecomment-436781540
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20181107/3d6dfb04/attachment-0001.html>


More information about the Github-comments mailing list