Skip to content

Commit a0b1aa1

Browse files
jasnellitaloacasas
authored andcommitted
readline: avoid using forEach
PR-URL: #11582 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e19ca8b commit a0b1aa1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/readline.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,8 @@ Interface.prototype._normalWrite = function(b) {
371371
// either '' or (conceivably) the unfinished portion of the next line
372372
string = lines.pop();
373373
this._line_buffer = string;
374-
lines.forEach(function(line) {
375-
this._onLine(line);
376-
}, this);
374+
for (var n = 0; n < lines.length; n++)
375+
this._onLine(lines[n]);
377376
} else if (string) {
378377
// no newlines this time, save what we have for next time
379378
this._line_buffer = string;

0 commit comments

Comments
 (0)