Remove unnecessary function object creation and Number#times
in Element._getContentFromAnonymousElement
.
This commit is contained in:
parent
9ef3f8d2ed
commit
82c9b9c783
@ -1,3 +1,5 @@
|
||||
* Remove unnecessary function object creation and `Number#times` in `Element._getContentFromAnonymousElement`. (kangax)
|
||||
|
||||
* Eliminate runtime forking and long method lookup in `Element.hasAttribute`. (kangax)
|
||||
|
||||
* Remove redundant ternary. (kangax)
|
||||
|
@ -1868,11 +1868,17 @@ Element._returnOffset = function(l, t) {
|
||||
};
|
||||
|
||||
Element._getContentFromAnonymousElement = function(tagName, html) {
|
||||
var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
|
||||
var div = new Element('div'),
|
||||
t = Element._insertionTranslations.tags[tagName];
|
||||
if (t) {
|
||||
div.innerHTML = t[0] + html + t[1];
|
||||
t[2].times(function() { div = div.firstChild });
|
||||
} else div.innerHTML = html;
|
||||
for (var i = t[2]; i--; ) {
|
||||
div = div.firstChild;
|
||||
}
|
||||
}
|
||||
else {
|
||||
div.innerHTML = html;
|
||||
}
|
||||
return $A(div.childNodes);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user