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>
This commit is contained in:
parent
42e55eb37b
commit
53cf483401
@ -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…
x
Reference in New Issue
Block a user