From e75e686431b7ed08de78c5b53d55dd33ff423ef9 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Fri, 11 May 2012 00:40:26 +0000 Subject: [PATCH] Shortcut checks for identical objects git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1336985 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/commons/math3/util/Pair.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/apache/commons/math3/util/Pair.java b/src/main/java/org/apache/commons/math3/util/Pair.java index 6d4e1bd4a..5a7dcff27 100644 --- a/src/main/java/org/apache/commons/math3/util/Pair.java +++ b/src/main/java/org/apache/commons/math3/util/Pair.java @@ -83,6 +83,9 @@ public class Pair { */ @Override public boolean equals(Object o) { + if (this == o) { + return true; + } if (!(o instanceof Pair)) { return false; } else {