Don't remove test directory on clean
[jquery.git] / src / selector.js
index c35fbb1..51f165a 100644 (file)
@@ -320,7 +320,10 @@ jQuery.extend({
                        // :not() is a special case that can be optimized by
                        // keeping it out of the expression list
                        if ( m[1] == ":" && m[2] == "not" )
-                               r = jQuery.filter(m[3], r, true).r;
+                               // optimize if only one selector found (most common case)
+                               r = isSimple.test( m[3] ) ?
+                                       jQuery.filter(m[3], r, true).r :
+                                       jQuery( r ).not( m[3] );
 
                        // We can get a big speed boost by filtering by class here
                        else if ( m[1] == "." )