Skip to content

Commit 26d0d94

Browse files
committed
Improve looping
1 parent bab73a3 commit 26d0d94

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/io.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,7 +3289,7 @@ class TFile {
32893289
// multipart messages requires special handling
32903290

32913291
const indx = hdr.indexOf('boundary='), view = new DataView(res);
3292-
let boundary = '', n = first, o = 0;
3292+
let boundary = '';
32933293
if (indx > 0) {
32943294
boundary = hdr.slice(indx + 9);
32953295
if ((boundary[0] === '"') && (boundary.at(-1) === '"'))
@@ -3300,7 +3300,7 @@ class TFile {
33003300
return send_new_request('noranges');
33013301
}
33023302

3303-
while (n < last) {
3303+
for(let n = first, o = 0; n < last; n += 2) {
33043304
let code1, code2 = view.getUint8(o), nline = 0, line = '',
33053305
finish_header = false, segm_start = 0, segm_last = -1;
33063306

@@ -3349,7 +3349,6 @@ class TFile {
33493349

33503350
reorder.addBuffer(n, res, o);
33513351

3352-
n += 2;
33533352
o += (segm_last - segm_start + 1);
33543353
}
33553354

0 commit comments

Comments
 (0)