<p>Don't use the files inode as the hash.  Although it looks like a good idea for de-duplicating links as well, it has several issues, including non-uniqueness of inodes across file systems.<br>
The way it was done hashing the inode but comparing the file name string pointers also made the hash mostly irrelevant, as it just stored filenames sharing the same inode in the same hash bucket but without<br>
actually doing any de-duplication, making the whole thing a convoluted way of converting to a list.</p>
<p>Instead, hash and compare the filenames themselves, which, even though it doesn't handle links de-duplication, is better than the non-functional previous code.</p>
<p>Also, directly build the list and only use the hash table as a way for checking for duplicates, which is both faster and gives a stable output.</p>
<p>See <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="377813042" data-permission-text="Issue title is private" data-url="https://github.com/geany/geany/issues/1989" data-hovercard-type="pull_request" data-hovercard-url="/geany/geany/pull/1989/hovercard" href="https://github.com/geany/geany/pull/1989">#1989</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/1991'>https://github.com/geany/geany/pull/1991</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>tm: Cleanup include lookup</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/1991/files#diff-0">src/tagmanager/tm_workspace.c</a>
    (18)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/1991.patch'>https://github.com/geany/geany/pull/1991.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/1991.diff'>https://github.com/geany/geany/pull/1991.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/1991">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ_cJkuAcul11TYGi7Qso1JgabJIoks5utrmygaJpZM4YX8nN">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ6UWRecrjXRCn4cvDJObeior90hKks5utrmygaJpZM4YX8nN.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"tm: Cleanup include lookup (#1991)"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany/pull/1991"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/1991",
"url": "https://github.com/geany/geany/pull/1991",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "tm: Cleanup include lookup (#1991)",
"sections": [
{
"text": "",
"activityTitle": "**Colomban Wendling**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@b4n",
"facts": [

]
},
{
"title": "Commit Summary",
"facts": [
{
"name": "08a3892",
"value": "tm: Cleanup include lookup"
}
]
},
{
"title": "File Changes",
"facts": [
{
"name": "Modified",
"value": "[src/tagmanager/tm_workspace.c](https://github.com/geany/geany/pull/1991/files#diff-0) (18 changes)"
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"geany/geany\",\n\"issueId\": 1991,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"geany/geany\",\n\"pullRequestId\": 1991\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/pull/1991"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/pull/1991.patch"
}
],
"@type": "OpenUri",
"name": "View patch"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/pull/1991.diff"
}
],
"@type": "OpenUri",
"name": "View diff"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 408930765\n}"
}
],
"themeColor": "26292E"
}
]</script>