Permalink
Browse files

tiny optimization

  • Loading branch information...
1 parent 70b3098 commit 4a8041eef9e77cc1aad82a1cc5fd136ead5d7670 @eldargab committed Sep 4, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/box.js
View
@@ -61,9 +61,10 @@ Box.prototype.execute = function (app) {
Box.prototype.done = function (val) {
this.isReady = true
this.val = val
- this.callbacks && this.callbacks.forEach(function (cb) {
- cb(val)
- })
+ if (!this.callbacks) return
+ for (var i = 0; i < this.callbacks.length; i++) {
+ this.callbacks[i](val)
+ }
this.callbacks = null
}

0 comments on commit 4a8041e

Please sign in to comment.