diff options
author | James M Snell <jasnell@gmail.com> | 2017-02-26 18:15:36 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-03-17 11:09:35 -0700 |
commit | 53cf483401383f1dbd2af1d6e0f9fdaf7bb71468 (patch) | |
tree | 07562d0287a39942f45985a0adc8a7b36c1d2304 /lib/readline.js | |
parent | 42e55eb37bb65541562ae6f6e2b636b6c4efb301 (diff) | |
download | android-node-v8-53cf483401383f1dbd2af1d6e0f9fdaf7bb71468.tar.gz android-node-v8-53cf483401383f1dbd2af1d6e0f9fdaf7bb71468.tar.bz2 android-node-v8-53cf483401383f1dbd2af1d6e0f9fdaf7bb71468.zip |
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>
Diffstat (limited to 'lib/readline.js')
-rw-r--r-- | lib/readline.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/readline.js b/lib/readline.js index b5dab31a5f..5237b258ed 100644 --- a/lib/readline.js +++ b/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; |