git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6b938e1
)
Optimized the clean() code to no longer use .trim() (speeds up working against long...
author
John Resig
<jeresig@gmail.com>
Mon, 9 Feb 2009 15:41:50 +0000
(15:41 +0000)
committer
John Resig
<jeresig@gmail.com>
Mon, 9 Feb 2009 15:41:50 +0000
(15:41 +0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
3f6c1f7
..
3a9eaa7
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-855,7
+855,7
@@
jQuery.extend({
});
// Trim whitespace, otherwise indexOf won't work as expected
});
// Trim whitespace, otherwise indexOf won't work as expected
- var tags = jQuery.trim( elem ).toLowerCase();
+ var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase();
var wrap =
// option or optgroup
var wrap =
// option or optgroup
@@
-895,11
+895,12
@@
jQuery.extend({
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
- var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
- div.firstChild && div.firstChild.childNodes :
+ var hasBody = /<tbody/i.test(elem),
+ tbody = !tags.indexOf("<table") && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
// String was a bare <thead> or <tfoot>
- wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
+ wrap[1] == "<table>" && !hasBody ?
div.childNodes :
[];
div.childNodes :
[];