Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b493c62

Browse files
committed
perf(jqLite): optimize jqLiteAcceptsData method
This doesn't show up too high in profiles, but this code is cleaner anyway
1 parent 35134a0 commit b493c62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/jqLite.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ function jqLiteIsTextNode(html) {
165165
function jqLiteAcceptsData(node) {
166166
// The window object can accept data but has no nodeType
167167
// Otherwise we are only interested in elements (1) and documents (9)
168-
return !node.nodeType || node.nodeType === 1 || node.nodeType === 9;
168+
var nodeType = node.nodeType;
169+
return nodeType === 1 || !nodeType || nodeType === 9;
169170
}
170171

171172
function jqLiteBuildFragment(html, context) {

0 commit comments

Comments
 (0)