From 64630eaf850797f45b523b3eadc9a158e78eb5a8 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Sun, 3 Feb 2013 15:31:23 -0500 Subject: [PATCH] Reduce Data.prototype.add by using the returned length value of this.owners.push(owner) Signed-off-by: Rick Waldron --- src/data.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/data.js b/src/data.js index 448decd00..054a520f5 100644 --- a/src/data.js +++ b/src/data.js @@ -16,8 +16,7 @@ Data.index = function( array, node ) { Data.prototype = { add: function( owner ) { - this.owners.push( owner ); - return (this.cache[ this.owners.length - 1 ] = {}); + return (this.cache[ this.owners.push( owner ) - 1 ] = {}); }, set: function( owner, data, value ) { var prop,