Skip to content

Simplify key code #3514

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

Merged
merged 1 commit into from
Jun 22, 2025
Merged

Conversation

Starbuck5
Copy link
Member

  • Removes unnecessary null checks (PyBool_FromLong always succeeds)
  • Stores directly into PyTuple_SET_ITEM (which steals reference)
  • Moves the index declaration into the for loop -- we're not on C89 anymore.

Removes unnecessary null checks (PyBool_FromLong always succeeds), stores directly into PyTuple_SET_ITEM (which steals reference), and moves the index declaration into the for loop -- we're not on C89 anymore.
@Starbuck5 Starbuck5 requested a review from a team as a code owner June 20, 2025 06:02
@Starbuck5 Starbuck5 added Code quality/robustness Code quality and resilience to changes key pygame.key labels Jun 20, 2025
Copy link
Member

@oddbookworm oddbookworm 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! 🎉

Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@MyreMylar MyreMylar merged commit 787650b into pygame-community:main Jun 22, 2025
26 checks passed
@ankith26 ankith26 added this to the 2.5.6 milestone Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality/robustness Code quality and resilience to changes key pygame.key
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants