Made a slight adjustment to $("expr") to make it faster.
This commit is contained in:
parent
34355cd698
commit
18f28ea7d4
12
src/jquery/jquery.js
vendored
12
src/jquery/jquery.js
vendored
|
@ -38,14 +38,14 @@ var jQuery = function(a,c) {
|
||||||
|
|
||||||
// Handle HTML strings
|
// Handle HTML strings
|
||||||
if ( typeof a == "string" ) {
|
if ( typeof a == "string" ) {
|
||||||
// HANDLE: $(html) -> $(array)
|
|
||||||
var m = /^[^<]*(<.+>)[^>]*$/.exec(a);
|
var m = /^[^<]*(<.+>)[^>]*$/.exec(a);
|
||||||
if ( m )
|
|
||||||
a = jQuery.clean( [ m[1] ] );
|
|
||||||
|
|
||||||
// HANDLE: $(expr)
|
a = m ?
|
||||||
else
|
// HANDLE: $(html) -> $(array)
|
||||||
return new jQuery( c ).find( a );
|
jQuery.clean( [ m[1] ] ) :
|
||||||
|
|
||||||
|
// HANDLE: $(expr)
|
||||||
|
jQuery.find( a, c );
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.setArray(
|
return this.setArray(
|
||||||
|
|
Loading…
Reference in a new issue