Use Util.adapt(). Look at this functional programming masterpiece.
I'm not sure how much actual utility is here, and how much I just like the gee-whiz factor. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5731 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -70,9 +70,7 @@ public class SortedHashMap extends HashMap
|
|||||||
override public function values () :Array
|
override public function values () :Array
|
||||||
{
|
{
|
||||||
// not very optimal, we need to look up each value from the sorted keys.
|
// not very optimal, we need to look up each value from the sorted keys.
|
||||||
return keys().map(function (key :Object, ... rest) :Object {
|
return keys().map(Util.adapt(get));
|
||||||
return get(key);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function forEach (fn :Function) :void
|
override public function forEach (fn :Function) :void
|
||||||
|
|||||||
Reference in New Issue
Block a user