Browse Source

readline: avoid using forEach

PR-URL: https://github.com/nodejs/node/pull/11582
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v6
James M Snell 8 years ago
parent
commit
53cf483401
  1. 5
      lib/readline.js

5
lib/readline.js

@ -392,9 +392,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;

Loading…
Cancel
Save