Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
readline: avoid using forEach
PR-URL: #11582
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
jasnell authored and italoacasas committed Mar 20, 2017
1 parent e19ca8b commit a0b1aa1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/readline.js
Expand Up @@ -371,9 +371,8 @@ Interface.prototype._normalWrite = function(b) {
// either '' or (conceivably) the unfinished portion of the next line
string = lines.pop();
this._line_buffer = string;
lines.forEach(function(line) {
this._onLine(line);
}, this);
for (var n = 0; n < lines.length; n++)
this._onLine(lines[n]);
} else if (string) {
// no newlines this time, save what we have for next time
this._line_buffer = string;
Expand Down

0 comments on commit a0b1aa1

Please sign in to comment.