]> source.dussan.org Git - jquery.git/commitdiff
Reduce Data.prototype.add by using the returned length value of this.owners.push...
authorRick Waldron <waldron.rick@gmail.com>
Sun, 3 Feb 2013 20:31:23 +0000 (15:31 -0500)
committerRick Waldron <waldron.rick@gmail.com>
Sun, 3 Feb 2013 20:31:23 +0000 (15:31 -0500)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
src/data.js

index 448decd00b18744ba5d24ac4e6c98728005892de..054a520f59a3da87493e0a722a412bedd72f8391 100644 (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,