commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [commons-collections] branch master updated: Make the code clearer (#119)
Date Tue, 26 Nov 2019 13:35:42 GMT
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new f086233  Make the code clearer (#119)
f086233 is described below

commit f08623354efe4d801e4c1e29c0eb970b166b2c8c
Author: Chen <50514813+dota17@users.noreply.github.com>
AuthorDate: Tue Nov 26 21:35:33 2019 +0800

    Make the code clearer (#119)
---
 src/main/java/org/apache/commons/collections4/list/TreeList.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java
index 7e04b44..fc24215 100644
--- a/src/main/java/org/apache/commons/collections4/list/TreeList.java
+++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java
@@ -24,6 +24,7 @@ import java.util.Deque;
 import java.util.Iterator;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
+import java.util.Objects;
 
 import org.apache.commons.collections4.OrderedIterator;
 
@@ -438,7 +439,7 @@ public class TreeList<E> extends AbstractList<E> {
                     return result;
                 }
             }
-            if (value == null ? value == object : value.equals(object)) {
+            if (Objects.equals(value, object)) {
                 return index;
             }
             if (getRightSubTree() != null) {


Mime
View raw message