From da628d371879d53bda278d6f3a74778f4fcd0270 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 7 Jul 2016 15:41:12 -0700 Subject: [PATCH] benchmark: remove unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove variables that are assigned but never used. (This was missed by the linter in previous versions of ESLint but is flagged by the current version. Updating the linter is contingent on this change or some similar remedy landing.) PR-URL: https://github.com/nodejs/node/pull/7600 Reviewed-By: Rod Vagg Reviewed-By: Michaƫl Zasso Reviewed-By: Jeremiah Senkpiel --- benchmark/http/_chunky_http_client.js | 4 ---- benchmark/static_http_server.js | 2 -- test/parallel/test-event-emitter-remove-listeners.js | 4 ---- test/parallel/test-tls-session-cache.js | 4 ---- test/sequential/test-pump-file2tcp-noexist.js | 5 ----- 5 files changed, 19 deletions(-) diff --git a/benchmark/http/_chunky_http_client.js b/benchmark/http/_chunky_http_client.js index 158be5a0eb6424..bde4eed7444e6f 100644 --- a/benchmark/http/_chunky_http_client.js +++ b/benchmark/http/_chunky_http_client.js @@ -50,8 +50,6 @@ function main(conf) { } } - var success = 0; - var failure = 0; var min = 10; var size = 0; var mod = 317; @@ -69,14 +67,12 @@ function main(conf) { if ((d.length === pattern.length && d === pattern) || (d.length > pattern.length && d.slice(0, pattern.length) === pattern)) { - success += 1; did = true; } else { pattern = 'HTTP/1.1 '; if ((d.length === pattern.length && d === pattern) || (d.length > pattern.length && d.slice(0, pattern.length) === pattern)) { - failure += 1; did = true; } } diff --git a/benchmark/static_http_server.js b/benchmark/static_http_server.js index 43c493675933e7..13067d7b3eb890 100644 --- a/benchmark/static_http_server.js +++ b/benchmark/static_http_server.js @@ -6,7 +6,6 @@ var port = 12346; var n = 700; var bytes = 1024 * 5; -var requests = 0; var responses = 0; var body = 'C'.repeat(bytes); @@ -37,6 +36,5 @@ server.listen(port, function() { }); }); req.id = i; - requests++; } }); diff --git a/test/parallel/test-event-emitter-remove-listeners.js b/test/parallel/test-event-emitter-remove-listeners.js index cc6f9516b5e3f3..95b39f4555b903 100644 --- a/test/parallel/test-event-emitter-remove-listeners.js +++ b/test/parallel/test-event-emitter-remove-listeners.js @@ -3,16 +3,12 @@ var common = require('../common'); var assert = require('assert'); var events = require('events'); -var count = 0; - function listener1() { console.log('listener1'); - count++; } function listener2() { console.log('listener2'); - count++; } function remove1() { diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js index c2bebc39dd1934..4b4dbda4a6dca2 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -89,11 +89,7 @@ function doTest(testOptions, callback) { var client = spawn(common.opensslCli, args, { stdio: [ 0, 1, 'pipe' ] }); - var err = ''; client.stderr.setEncoding('utf8'); - client.stderr.on('data', function(chunk) { - err += chunk; - }); client.on('exit', function(code) { console.error('done'); assert.equal(code, 0); diff --git a/test/sequential/test-pump-file2tcp-noexist.js b/test/sequential/test-pump-file2tcp-noexist.js index 66d1e1119ff6e2..4f708bf31ce803 100644 --- a/test/sequential/test-pump-file2tcp-noexist.js +++ b/test/sequential/test-pump-file2tcp-noexist.js @@ -26,9 +26,6 @@ var server = net.createServer(function(stream) { server.listen(common.PORT, function() { var conn = net.createConnection(common.PORT); conn.setEncoding('utf8'); - conn.on('data', function(chunk) { - buffer += chunk; - }); conn.on('end', function() { conn.end(); @@ -39,8 +36,6 @@ server.listen(common.PORT, function() { }); }); -var buffer = ''; - process.on('exit', function() { assert.equal(true, got_error); assert.equal(true, conn_closed);