Reduce Data.prototype.add by using the returned length value of this.owners.push(owner)

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
Rick Waldron 2013-02-03 15:31:23 -05:00
parent 7f94a5cc3a
commit 64630eaf85

View File

@ -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,