Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary "id" member of TrNotification in gtk/notify.c #851

Merged
merged 3 commits into from Aug 7, 2021

Conversation

xavery
Copy link
Contributor

@xavery xavery commented Feb 28, 2019

The "id" member's only purpose is to serve as the key for the
active_notifications hash table. However, the same thing can be very easily
achieved by switching the GHashTable's hash/equal functions to "direct", which
just use the void pointers (which all keys are in a GHashTable) directly as if
they were values, and use GUINT_TO_POINTER() when referring to this hash table's
key.

The "id" member's only purpose is to serve as the key for the
active_notifications hash table. However, the same thing can be very easily
achieved by switching the GHashTable's hash/equal functions to "direct", which
just use the void pointers (which all keys are in a GHashTable) directly as if
they were values, and use GUINT_TO_POINTER() when referring to this hash table's
key.
Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the suggestion!

@mikedld mikedld merged commit 79e8bc5 into transmission:master Aug 7, 2021
@mikedld mikedld added this to the 3.1x milestone Aug 7, 2021
@xavery xavery deleted the gtk-ghashtable-fix branch August 8, 2021 08:12
@mikedld mikedld modified the milestones: 3.1x, 3.0x Aug 18, 2021
@ckerr ckerr modified the milestones: 3.0x, 4.0.0-beta.1 Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants