{"action":"created","issue":{"url":"https://api.github.com/repos/cquery-project/cquery/issues/748","repository_url":"https://api.github.com/repos/cquery-project/cquery","labels_url":"https://api.github.com/repos/cquery-project/cquery/issues/748/labels{/name}","comments_url":"https://api.github.com/repos/cquery-project/cquery/issues/748/comments","events_url":"https://api.github.com/repos/cquery-project/cquery/issues/748/events","html_url":"https://github.com/cquery-project/cquery/issues/748","id":345562294,"node_id":"MDU6SXNzdWUzNDU1NjIyOTQ=","number":748,"title":"Something screwy in CompareGroups?","user":{"login":"dimbleby","id":875184,"node_id":"MDQ6VXNlcjg3NTE4NA==","avatar_url":"https://avatars3.githubusercontent.com/u/875184?v=4","gravatar_id":"","url":"https://api.github.com/users/dimbleby","html_url":"https://github.com/dimbleby","followers_url":"https://api.github.com/users/dimbleby/followers","following_url":"https://api.github.com/users/dimbleby/following{/other_user}","gists_url":"https://api.github.com/users/dimbleby/gists{/gist_id}","starred_url":"https://api.github.com/users/dimbleby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimbleby/subscriptions","organizations_url":"https://api.github.com/users/dimbleby/orgs","repos_url":"https://api.github.com/users/dimbleby/repos","events_url":"https://api.github.com/users/dimbleby/events{/privacy}","received_events_url":"https://api.github.com/users/dimbleby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-29T20:59:47Z","updated_at":"2018-07-29T21:12:47Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I've been trying to track down an issue where I'm able to find a function definition once - but not a second time.\r\n\r\nI *think* I've pinned it on [`CompareGroups()`](https://github.com/cquery-project/cquery/blob/236118e5cfaf0fef38b496b124c99adc1e880aca/src/query.cc#L171), which:\r\n\r\n* sorts the vectors `current_data` and `previous_data`\r\n* then walks them in tandem, looking for differences\r\n\r\nThe problem, I believe, is that the sorting is by `id`, whereas the checking-for-differences is by `usr`.\r\n\r\nThe consequence is that if the lists are not identical, but there is some thing that really is in both lists, and you get unlucky - then that thing will be first treated as added, then as removed, and removed will win.\r\n\r\nSo if I'm right then I reckon that the sorting wants to be by `usr`. \r\n\r\nOr am I way off base?"},"comment":{"url":"https://api.github.com/repos/cquery-project/cquery/issues/comments/408706308","html_url":"https://github.com/cquery-project/cquery/issues/748#issuecomment-408706308","issue_url":"https://api.github.com/repos/cquery-project/cquery/issues/748","id":408706308,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODcwNjMwOA==","user":{"login":"jacobdufault","id":356714,"node_id":"MDQ6VXNlcjM1NjcxNA==","avatar_url":"https://avatars3.githubusercontent.com/u/356714?v=4","gravatar_id":"","url":"https://api.github.com/users/jacobdufault","html_url":"https://github.com/jacobdufault","followers_url":"https://api.github.com/users/jacobdufault/followers","following_url":"https://api.github.com/users/jacobdufault/following{/other_user}","gists_url":"https://api.github.com/users/jacobdufault/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobdufault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobdufault/subscriptions","organizations_url":"https://api.github.com/users/jacobdufault/orgs","repos_url":"https://api.github.com/users/jacobdufault/repos","events_url":"https://api.github.com/users/jacobdufault/events{/privacy}","received_events_url":"https://api.github.com/users/jacobdufault/received_events","type":"User","site_admin":false},"created_at":"2018-07-29T21:12:47Z","updated_at":"2018-07-29T21:12:47Z","author_association":"MEMBER","body":"Take a look at the IdMap constructor to see how id is derived from usr.\r\n\r\nhttps://github.com/cquery-project/cquery/blob/master/src/query.cc#L390-L409"}}
{"actor":{"display_login":"jacobdufault"}}