From d5d8670783ac5c784a341868b496b1c81e133679 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Tue, 25 Sep 2018 15:41:55 -0500 Subject: [PATCH] lib: remove some useless assignments PR-URL: https://github.com/nodejs/node/pull/23199 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater --- lib/events.js | 2 +- lib/internal/readline.js | 2 +- lib/net.js | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/events.js b/lib/events.js index 5dfa34469b09af..3fce38f881b9fb 100644 --- a/lib/events.js +++ b/lib/events.js @@ -224,7 +224,7 @@ function _addListener(target, type, listener, prepend) { if (existing === undefined) { // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; + events[type] = listener; ++target._eventsCount; } else { if (typeof existing === 'function') { diff --git a/lib/internal/readline.js b/lib/internal/readline.js index 45125db0c223ef..3974ff4468bf54 100644 --- a/lib/internal/readline.js +++ b/lib/internal/readline.js @@ -258,7 +258,7 @@ function* emitKeys(stream) { s += (ch = yield); if (ch >= '0' && ch <= '9') { - s += (ch = yield); + s += yield; } } diff --git a/lib/net.js b/lib/net.js index d21040198de631..a9c940c6831f46 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1071,10 +1071,6 @@ function afterConnect(status, handle, req, readable, writable) { return; } - // Update handle if it was wrapped - // TODO(indutny): assert that the handle is actually an ancestor of old one - handle = self._handle; - debug('afterConnect'); assert(self.connecting);