Rollback r5502.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5503 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -63,10 +63,10 @@ public class ExpiringSet extends EventDispatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
// from Set
|
// from Set
|
||||||
public function forEach (fn :Function, thisObject :* = null) :void
|
public function forEach (fn :Function) :void
|
||||||
{
|
{
|
||||||
for each (var e :ExpiringElement in _data) {
|
for each (var e :ExpiringElement in _data) {
|
||||||
fn.call(thisObject, e);
|
fn(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,11 +263,11 @@ public class HashMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
public function forEach (fn :Function, thisObject :* = null) :void
|
public function forEach (fn :Function) :void
|
||||||
{
|
{
|
||||||
if (_simpleData != null) {
|
if (_simpleData != null) {
|
||||||
for (var key :Object in _simpleData) {
|
for (var key :Object in _simpleData) {
|
||||||
fn.call(thisObject, key, _simpleData[key]);
|
fn(key, _simpleData[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ public class HashMap
|
|||||||
for (var ii :int = _entries.length - 1; ii >= 0; ii--) {
|
for (var ii :int = _entries.length - 1; ii >= 0; ii--) {
|
||||||
for (var e :Entry = (_entries[ii] as Entry); e != null;
|
for (var e :Entry = (_entries[ii] as Entry); e != null;
|
||||||
e = e.next) {
|
e = e.next) {
|
||||||
fn.call(thisObject, e.getOriginalKey(), e.value);
|
fn(e.getOriginalKey(), e.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,10 +76,10 @@ public class HashSet
|
|||||||
return (_hashMap.containsKey(o));
|
return (_hashMap.containsKey(o));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forEach (fn :Function, thisObject :* = null) :void
|
public function forEach (fn :Function) :void
|
||||||
{
|
{
|
||||||
_hashMap.forEach(function (key :Object, val :Object) :void {
|
_hashMap.forEach(function (key :Object, val :Object) :void {
|
||||||
fn.call(thisObject, key);
|
fn(key);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public interface Map
|
|||||||
* Call the specified function, which accepts two args: key and value,
|
* Call the specified function, which accepts two args: key and value,
|
||||||
* for every mapping.
|
* for every mapping.
|
||||||
*/
|
*/
|
||||||
function forEach (fn :Function, thisObject :* = null) :void;
|
function forEach (fn :Function) :void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this map contains no elements.
|
* Returns true if this map contains no elements.
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public interface Set
|
|||||||
function contains (o :Object) :Boolean;
|
function contains (o :Object) :Boolean;
|
||||||
|
|
||||||
/** Call the specified function, which accepts an element as an argument. */
|
/** Call the specified function, which accepts an element as an argument. */
|
||||||
function forEach (fn :Function, thisObject :* = null) :void;
|
function forEach (fn :Function) :void;
|
||||||
|
|
||||||
/** Retuns the number of elements in this set. */
|
/** Retuns the number of elements in this set. */
|
||||||
function size () :int; // @TSC - should this be uint?
|
function size () :int; // @TSC - should this be uint?
|
||||||
|
|||||||
@@ -77,11 +77,11 @@ public class SortedHashMap extends HashMap
|
|||||||
return vals;
|
return vals;
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function forEach (fn :Function, thisObject :* = null) :void
|
override public function forEach (fn :Function) :void
|
||||||
{
|
{
|
||||||
var keys :Array = keys();
|
var keys :Array = keys();
|
||||||
for each (var key :Object in keys) {
|
for each (var key :Object in keys) {
|
||||||
fn.call(thisObject, key, get(key));
|
fn(key, get(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user