Improve performance of get() for negative indices. Fixes #5476.

This commit is contained in:
Anton M 2010-11-19 12:28:13 +01:00
parent 0838bdf52c
commit 5c0b5d2560
2 changed files with 6 additions and 6 deletions

View file

@ -215,7 +215,7 @@ jQuery.fn = jQuery.prototype = {
this.toArray() :
// Return just the object
( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
( num < 0 ? this[ this.length + num ] : this[ num ] );
},
// Take an array of elements and push it onto the stack