You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/04/21 04:40:55 UTC

[GitHub] [commons-collections] arturobernalg opened a new pull request #229: COLLECTIONS-789 - Redundant 'if' statement

arturobernalg opened a new pull request #229:
URL: https://github.com/apache/commons-collections/pull/229


   * Simplified to a single return statement.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-collections] coveralls commented on pull request #229: COLLECTIONS-789 - Redundant 'if' statement

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #229:
URL: https://github.com/apache/commons-collections/pull/229#issuecomment-823774649


   
   [![Coverage Status](https://coveralls.io/builds/38994224/badge)](https://coveralls.io/builds/38994224)
   
   Coverage decreased (-0.03%) to 90.109% when pulling **3bba0a40cdcf3df93ff5ff0ae78af4bf7a18a7a7 on arturobernalg:feature/COLLECTIONS-789** into **e1f23b035d7caeab8333e8df6739eb143b64affb on apache:master**.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-collections] LarsBodewig commented on a change in pull request #229: COLLECTIONS-789 - Redundant 'if' statement

Posted by GitBox <gi...@apache.org>.
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org