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

Removed redundant if checks #826

Merged
merged 1 commit into from
Aug 8, 2017
Merged

Removed redundant if checks #826

merged 1 commit into from
Aug 8, 2017

Conversation

dniym
Copy link
Contributor

@dniym dniym commented Aug 6, 2017

Removals

  • Removes approx 30 redundant if checks from the PKListener. These If Checks will never fire because ignoreCancelled=true is set in the @eventhandler line. Thus they just serve to make the listener longer.

@@ -812,7 +765,7 @@ public void onPlayerChat(AsyncPlayerChatEvent event) {
event.setFormat(format);
}

@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
Copy link
Member

Choose a reason for hiding this comment

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

We would want to leave this EventHandler as is.

Copy link
Contributor Author

@dniym dniym Aug 8, 2017

Choose a reason for hiding this comment

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

I feel like with this eventHandler changed, the lines just below there do the exact same thing.
if (event.isCancelled())
return;

Unless there's just some super special circumstance where shockwave needs to be checked even if the event is cancelled, in that case you should probably re-add the other two lines that are removed in that method. (830-831)

@ChristopherWMM ChristopherWMM merged commit 3f81ee0 into ProjectKorra:wip Aug 8, 2017
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.

None yet

2 participants