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

Minor changes to remove checks for logically impossible situations #234

Merged
merged 1 commit into from
Aug 5, 2023

Conversation

TheRealMothebad
Copy link
Contributor

Two changes:

  1. The tool_event InputEvent is either a MouseMotion or a MouseButton, so the check for the InputEvent being a MouseButton event does not need to occur if the object is already identified as a MouseMotion.
  2. In the tool_event MouseButton path, if the elif section is reached then event.pressed is guaranteed to be false, so checking that it is false is redundant.

Two changes:
1. The tool_event InputEvent is either a MouseMotion or a MouseButton, so the check for the InputEvent being a MouseButton event does not need to occur if the object is already identified as a MouseMotion.
2. In the tool_event MouseButton path, if the elif section is reached then event.pressed is guaranteed to be false, so checking that it is false is redundant.
@mbrlabs mbrlabs merged commit 4e98346 into mbrlabs:main Aug 5, 2023
@mbrlabs
Copy link
Owner

mbrlabs commented Aug 5, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants