Skip to content

Commit

Permalink
readline: avoid using forEach
Browse files Browse the repository at this point in the history
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
Original file line number Diff line number Diff line change
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.