Various small fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4258 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -25,6 +25,17 @@ public class Util
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A nicer test for equals that works if the objects implement Equalable
|
||||
*/
|
||||
public static function equals (obj1 :Object, obj2 :Object) :Boolean
|
||||
{
|
||||
// catch various common cases (both primitive or null)
|
||||
return (obj1 === obj2) ||
|
||||
// otherwise, they're only possibly still equal if Equalable
|
||||
((obj1 is Equalable) && (obj1 as Equalable).equals(obj2));
|
||||
}
|
||||
|
||||
public static function cast (obj :Object, clazz :Class) :Object
|
||||
{
|
||||
if (obj == null || obj is clazz) {
|
||||
|
||||
Reference in New Issue
Block a user