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 processing in ErrorResponse#test(ErrorResponse... #2023

Merged
merged 3 commits into from
May 6, 2022

Conversation

java-coding-prodigy
Copy link
Contributor

@java-coding-prodigy java-coding-prodigy commented Feb 9, 2022

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

  • Currently, ErrorResponse#test(ErrorResponse... produces an EnumSet of the responses, which it then passes to ErroResponse#test(Collection
  • That method however, creates another EnumSet, which is unnecessary processing.
  • To fix that, this PR will create its own predicate without calling the other method.

@java-coding-prodigy
Copy link
Contributor Author

java-coding-prodigy commented Feb 9, 2022

I seem to have messed something up, GitHub shows a lot of other commits somehow.

Should I have compared with master instead of development?

@Chew
Copy link
Contributor

Chew commented Feb 9, 2022

Yes, change the target to master

@java-coding-prodigy java-coding-prodigy changed the base branch from development to master February 9, 2022 02:37
@java-coding-prodigy
Copy link
Contributor Author

Yes, change the target to master

Oh thanks, it worked, I thought we had to compare with development.

@java-coding-prodigy
Copy link
Contributor Author

java-coding-prodigy commented Feb 9, 2022

However, my change does create a small amount of code duplication, to combat this, I was considering making a private method which returns a Predicate<Throwable> with the parameters of EnumSet<ErrorResponse>

@MinnDevelopment MinnDevelopment merged commit 975c470 into discord-jda:master May 6, 2022
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

3 participants