Added a performance improvement to preFilter.CLASS from LosT on the Sizzle.js mailing list.
This commit is contained in:
parent
aa7616cf9a
commit
0468e31bf7
|
@ -332,11 +332,12 @@ var Expr = Sizzle.selectors = {
|
||||||
CLASS: function(match, curLoop, inplace, result, not){
|
CLASS: function(match, curLoop, inplace, result, not){
|
||||||
match = " " + match[1].replace(/\\/g, "") + " ";
|
match = " " + match[1].replace(/\\/g, "") + " ";
|
||||||
|
|
||||||
for ( var i = 0; curLoop[i] != null; i++ ) {
|
var elem;
|
||||||
if ( curLoop[i] ) {
|
for ( var i = 0; (elem = curLoop[i]) != null; i++ ) {
|
||||||
if ( not ^ (" " + curLoop[i].className + " ").indexOf(match) >= 0 ) {
|
if ( elem ) {
|
||||||
|
if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) {
|
||||||
if ( !inplace )
|
if ( !inplace )
|
||||||
result.push( curLoop[i] );
|
result.push( elem );
|
||||||
} else if ( inplace ) {
|
} else if ( inplace ) {
|
||||||
curLoop[i] = false;
|
curLoop[i] = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue