[
https://issues.apache.org/jira/browse/COLLECTIONS-789?focusedWorklogId=698187&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-698187
]
ASF GitHub Bot logged work on COLLECTIONS-789:
----------------------------------------------
Author: ASF GitHub Bot
Created on: 18/Dec/21 02:42
Start Date: 18/Dec/21 02:42
Worklog Time Spent: 10m
Work Description: LarsBodewig commented on a change in pull request #229:
URL:
https://github.com/apache/commons-collections/pull/229#discussion_r771772352
##########
File path:
src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
##########
@@ -1348,10 +1348,7 @@ public void testHashCode() {
final Equator<Integer> e = new Equator<Integer>() {
@Override
public boolean equate(final Integer o1, final Integer o2) {
- if (o1 % 2 == 0 ^ o2 % 2 == 0) {
- return false;
- }
- return true;
+ return !(o1 % 2 == 0 ^ o2 % 2 == 0);
Review comment:
Newbie myself, but isn't that equivalent to `(o1 % 2 == 0) == (o2 % 2 ==
0)`? I have no idea what's easier to read though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 698187)
Time Spent: 0.5h (was: 20m)
> Redundant 'if' statement
> ------------------------
>
> Key: COLLECTIONS-789
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-789
> Project: Commons Collections
> Issue Type: Sub-task
> Reporter: Arturo Bernal
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Simplified to a single return statement.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)