Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
vectors instead of arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
honzabrecka committed Nov 18, 2014
1 parent 1471780 commit f7baa33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/com/codecatalyst/promise/Consequence.as
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class CallbackQueue
/**
* Queued Callback(s).
*/
protected const queuedCallbacks:Array = new Array(1e4);
protected const queuedCallbacks:Vector.<Callback> = new Vector.<Callback>(1e4, true);

/**
* Interval identifier.
Expand Down
11 changes: 5 additions & 6 deletions src/com/codecatalyst/promise/Resolver.as
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ package com.codecatalyst.promise
*/
private var _promise:Promise = null;

[ArrayElementType("com.codecatalyst.promise.Consequence")]
/**
* Pending Consequences chained to this Resolver.
*/
private var consequences:Array = [];
private var consequences:Vector.<Consequence>;

/**
* Indicates whether this Resolver has been completed.
Expand All @@ -104,7 +103,7 @@ package com.codecatalyst.promise
public function Resolver()
{
this._promise = new Promise( this );
this.consequences = [];
this.consequences = new Vector.<Consequence>();
}

// ========================================
Expand Down Expand Up @@ -252,11 +251,11 @@ package com.codecatalyst.promise
completionValue = value;
completed = true;

for each ( var consequence:Consequence in consequences )
for (var i:uint = 0, l:uint = consequences.length; i < l; i++)
{
consequence.trigger( completionAction, completionValue );
consequences[i].trigger( completionAction, completionValue );
}
consequences = [];
consequences = new Vector.<Consequence>();
}
}
}

0 comments on commit f7baa33

Please sign in to comment.