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

Commit 187b1b8

Browse files
committed
perf(jqLite): only take str.split() path when needed
bda673f changed code to only use `str.split()` when necessary, but the result was that `str.split()` would always be taken unless ' ' was the first character in the string, negating the effectiveness of the perf fix. Closes #8648
1 parent b24e381 commit 187b1b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jqLite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ forEach({
728728
}
729729

730730
// http://jsperf.com/string-indexof-vs-split
731-
var types = type.indexOf(' ') ? type.split(' ') : [type];
731+
var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];
732732
var i = types.length;
733733

734734
while (i--) {

0 commit comments

Comments
 (0)