From 3b863e30fabea29f66adcdc7afcc3dfb563e48fc Mon Sep 17 00:00:00 2001 From: Tom Conkling Date: Thu, 17 Apr 2008 19:14:42 +0000 Subject: [PATCH] Per Ray's suggestion, this returns undefined, rather than null, if the object is not found git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5004 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/ArrayUtil.as | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/util/ArrayUtil.as b/src/as/com/threerings/util/ArrayUtil.as index 2ead45f15..b975a5807 100644 --- a/src/as/com/threerings/util/ArrayUtil.as +++ b/src/as/com/threerings/util/ArrayUtil.as @@ -120,15 +120,15 @@ public class ArrayUtil /** * Returns the first item in the array for which the predicate function returns true, or - * null if no such item was found. The predicate function should be of type: + * undefined if no such item was found. The predicate function should be of type: * function (element :*) :Boolean { } * - * @return the matching element, or null if no matching element was found. + * @return the matching element, or undefined if no matching element was found. */ public static function findIf (arr :Array, predicate :Function) :* { var index :int = (arr != null ? indexIf(arr, predicate) : -1); - return (index >= 0 ? arr[index] : null); + return (index >= 0 ? arr[index] : undefined); } /**