diff options
author | John Resig <jeresig@gmail.com> | 2007-01-14 22:03:11 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2007-01-14 22:03:11 +0000 |
commit | 18f28ea7d46d5adce24565f277529c798ebf1763 (patch) | |
tree | c751dda7760f6f1e79f6676faa9c8e9087ab525e /src | |
parent | 34355cd6986d5939dc711c531263cb561cba5f24 (diff) | |
download | jquery-18f28ea7d46d5adce24565f277529c798ebf1763.tar.gz jquery-18f28ea7d46d5adce24565f277529c798ebf1763.zip |
Made a slight adjustment to $("expr") to make it faster.
Diffstat (limited to 'src')
-rw-r--r-- | src/jquery/jquery.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 151f68fdf..86d2bd38d 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -38,14 +38,14 @@ var jQuery = function(a,c) { // Handle HTML strings if ( typeof a == "string" ) { - // HANDLE: $(html) -> $(array) var m = /^[^<]*(<.+>)[^>]*$/.exec(a); - if ( m ) - a = jQuery.clean( [ m[1] ] ); + + a = m ? + // HANDLE: $(html) -> $(array) + jQuery.clean( [ m[1] ] ) : - // HANDLE: $(expr) - else - return new jQuery( c ).find( a ); + // HANDLE: $(expr) + jQuery.find( a, c ); } return this.setArray( |