diff options
author | Majid Arif Siddiqui <me@majidarif.com> | 2014-08-14 11:15:24 +0800 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-09-05 09:19:32 -0700 |
commit | 176f0bd3dfd58faf1675851cd2029e05d302f1fb (patch) | |
tree | 0beec659659a181c406b6d70dc71a0cf590bccd4 /lib/_stream_duplex.js | |
parent | 86bb7fa5cdc2f0492ecc2972c00b6805b6be8e9c (diff) | |
download | android-node-v8-176f0bd3dfd58faf1675851cd2029e05d302f1fb.tar.gz android-node-v8-176f0bd3dfd58faf1675851cd2029e05d302f1fb.tar.bz2 android-node-v8-176f0bd3dfd58faf1675851cd2029e05d302f1fb.zip |
lib: improved forEach object performance
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'lib/_stream_duplex.js')
-rw-r--r-- | lib/_stream_duplex.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js index c5a741c466..75cf30d798 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -31,10 +31,12 @@ var Writable = require('_stream_writable'); util.inherits(Duplex, Readable); -Object.keys(Writable.prototype).forEach(function(method) { +var keys = Object.keys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -}); +} function Duplex(options) { if (!(this instanceof Duplex)) |