No need to do the closest match if no selectors are passed in.

This commit is contained in:
jeresig 2009-12-03 10:51:04 -05:00
parent e534a310c7
commit 4daae7a79f
2 changed files with 34 additions and 17 deletions

View file

@ -58,7 +58,7 @@ jQuery.fn.extend({
if ( jQuery.isArray( selectors ) ) {
var ret = [], cur = this[0], selector;
if ( cur ) {
if ( cur && selectors.length ) {
for ( var i = 0, l = selectors.length; i < l; i++ ) {
selectors[i] = jQuery.expr.match.POS.test( selector ) ?
jQuery( selector, context || this.context ) :