commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1336985 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java
Date Fri, 11 May 2012 00:40:27 GMT
Author: sebb
Date: Fri May 11 00:40:26 2012
New Revision: 1336985

URL: http://svn.apache.org/viewvc?rev=1336985&view=rev
Log:
Shortcut checks for identical objects

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java?rev=1336985&r1=1336984&r2=1336985&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Pair.java Fri May
11 00:40:26 2012
@@ -83,6 +83,9 @@ public class Pair<K, V> {
      */
     @Override
     public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
         if (!(o instanceof Pair)) {
             return false;
         } else {



Mime
View raw message