From 364e330a7907bdfd6b3df50e8ed6caf266437472 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 --- 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 ff1648d6aa13e7..09abec75ba09e9 100644 --- a/lib/events.js +++ b/lib/events.js @@ -220,7 +220,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 fdf7e8a1d0f910..b5cdb894fc96df 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1081,10 +1081,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);