git ssb

2+

Dominic / pull-stream



Commit 856f3c822d3053b57d2045da16a0d9d070e053d7

perf: don't access array out of bounds

Friedel Ziegelmayer committed on 9/4/2016, 11:18:03 AM
Parent: b79142bcfd248df4fb1f0fd15d0af8dd8cf7e855

Files changed

sources/values.jschanged
sources/values.jsView
@@ -14,8 +14,10 @@
1414 var i = 0
1515 return function (abort, cb) {
1616 if(abort)
1717 return abortCb(cb, abort, onAbort)
18- cb(i >= array.length || null, array[i++])
18+ if(i >= array.length)
19+ cb(true)
20+ else
21+ cb(null, array[i++])
1922 }
2023 }
21-

Built with git-ssb-web