Check that the other name is the same subclass of Name, not just a Name.

(And found a faster way to compare the classes of two objects.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4321 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-08-11 23:54:41 +00:00
parent 51a40c5f4f
commit c85996ae5d
+3 -1
View File
@@ -43,7 +43,9 @@ public class Name extends Object
// from interface Hashable
public function equals (other :Object) :Boolean
{
return (ClassUtil.getClass(other) == Name) &&
return (other != null) &&
// this is a check to see if they are the same class
(other.constructor == Object(this).constructor) &&
(getNormal() === (other as Name).getNormal());
}