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

Commit fafbd49

Browse files
committed
perf(jqLite): microoptimization in chaining fn
note: no siginificant difference observed in macrobenchmarks, so this is just to make me feel better :)
1 parent bda673f commit fafbd49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/jqLite.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,9 @@ forEach({
930930
*/
931931
JQLite.prototype[name] = function(arg1, arg2, arg3) {
932932
var value;
933-
for(var i=0; i < this.length; i++) {
933+
var nodeCount = this.length;
934+
935+
for(var i=0; i < nodeCount; i++) {
934936
if (isUndefined(value)) {
935937
value = fn(this[i], arg1, arg2, arg3);
936938
if (isDefined(value)) {

0 commit comments

Comments
 (0)