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

Use Comparator factory methods. #8728

Merged
merged 3 commits into from
Aug 6, 2022

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Aug 3, 2022

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Simplify audio and video stream comparisons using the Comparator factory methods.
  • Use Comparator.comparingDouble() in the preference search to avoid boxing.

Fixes the following issue(s)

  • Fixes #

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@Isira-Seneviratne Isira-Seneviratne marked this pull request as ready for review August 3, 2022 00:51
@AudricV AudricV added the codequality Improvements to the codebase to improve the code quality label Aug 3, 2022
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Code looks good to me

@@ -84,7 +84,7 @@ public FuzzyScore(final Locale locale) {
* @return result score
* @throws IllegalArgumentException if the term or query is {@code null}
*/
public Integer fuzzyScore(final CharSequence term, final CharSequence query) {
public int fuzzyScore(final CharSequence term, final CharSequence query) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this was taken from here. Does the apache license allow modifying code? If so, does it require changes to be documented?

Copy link
Member Author

@Isira-Seneviratne Isira-Seneviratne Aug 5, 2022

Choose a reason for hiding this comment

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

I undid the change, just in case.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

I tested the download dialog, also ListHelper tests pass, so this is fine

@Stypox Stypox merged commit 80fb21e into TeamNewPipe:dev Aug 6, 2022
@sonarcloud
Copy link

sonarcloud bot commented Aug 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Isira-Seneviratne Isira-Seneviratne deleted the Comparator_factory branch August 6, 2022 10:42
@Stypox Stypox mentioned this pull request Aug 27, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants