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
This commit is contained in:
@@ -33,7 +33,7 @@ public class ObjectUtil
|
|||||||
*/
|
*/
|
||||||
public static boolean equals (Object o1, Object o2)
|
public static boolean equals (Object o1, Object o2)
|
||||||
{
|
{
|
||||||
return (o1 == null) ? (o2 == null) : o1.equals(o2);
|
return (o1 == o2) || ((o1 != null) && o1.equals(o2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user