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

MATH-1572: Simplify conditional expressions #193

Closed
wants to merge 1 commit into from
Closed

MATH-1572: Simplify conditional expressions #193

wants to merge 1 commit into from

Conversation

arturobernalg
Copy link
Member

  • Simplify bitwise
  • Simplify boolean expression
  • Simplify conditional expression
  • Redundant 'if' statement

Copy link
Contributor

@aherbert aherbert left a comment

Choose a reason for hiding this comment

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

All changes look good.

@@ -187,10 +187,7 @@ public int compare(WeightedObservedPoint p1,
return comp;
}
comp = Double.compare(p1.getWeight(), p2.getWeight());
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to store the result in comp. Just return the result direct.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, inline variable.
TY

* Simplify boolean expression
* Simplify conditional expression
* Redundant 'if' statement
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 90.487% when pulling b71e2ab on arturobernalg:feature/MATH-1572 into 771a218 on apache:master.

@aherbert aherbert changed the title Simplify improvements: MATH-1572: Simplify conditional expressions Aug 6, 2021
@aherbert
Copy link
Contributor

aherbert commented Aug 6, 2021

This is all fine. Can you update the commit message to prefix with MATH-1572.

@aherbert
Copy link
Contributor

aherbert commented Aug 7, 2021

Closed by commit 1c8d8da

@aherbert aherbert closed this Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants