From 962ebeec5372a2ea10081837a639ec60f4153d30 Mon Sep 17 00:00:00 2001 From: "samskivert@gmail.com" Date: Thu, 30 Sep 2004 23:49:36 +0000 Subject: [PATCH] Modified implementation of equals() so that it's quicker when the two references point to the same object. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1510 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../samskivert/src/java/com/samskivert/util/ObjectUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/ObjectUtil.java b/projects/samskivert/src/java/com/samskivert/util/ObjectUtil.java index 43284959..df33df6a 100644 --- a/projects/samskivert/src/java/com/samskivert/util/ObjectUtil.java +++ b/projects/samskivert/src/java/com/samskivert/util/ObjectUtil.java @@ -33,7 +33,7 @@ public class ObjectUtil */ public static boolean equals (Object o1, Object o2) { - return (o1 == null) ? (o2 == null) : o1.equals(o2); + return (o1 == o2) || ((o1 != null) && o1.equals(o2)); } /**