summaryrefslogtreecommitdiff
path: root/test/pummel/test-net-many-clients.js
diff options
context:
space:
mode:
authorJackson Tian <puling.tyq@alibaba-inc.com>2016-02-19 11:01:11 +0800
committerJames M Snell <jasnell@gmail.com>2016-03-21 16:42:58 -0700
commit4d78121b7786ee5b676d45b9d11e9a89d8dd249c (patch)
treef47c73370ebf0887c86e9a29d9ae580fa1107805 /test/pummel/test-net-many-clients.js
parentbac6c8505690b93cead95ee3053353c8e625cdf0 (diff)
downloadnode-new-4d78121b7786ee5b676d45b9d11e9a89d8dd249c.tar.gz
lib: simplify code with String.prototype.repeat()
use String.prototype.repeat() to simplify code, less code, more semantically. PR-URL: https://github.com/nodejs/node/pull/5359 Reviewed-By: Michaƫl Zasso <mic.besace@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/pummel/test-net-many-clients.js')
-rw-r--r--test/pummel/test-net-many-clients.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js
index 6d9dde1ddb..cb766ec1a4 100644
--- a/test/pummel/test-net-many-clients.js
+++ b/test/pummel/test-net-many-clients.js
@@ -11,10 +11,7 @@ var connections_per_client = 5;
// measured
var total_connections = 0;
-var body = '';
-for (var i = 0; i < bytes; i++) {
- body += 'C';
-}
+var body = 'C'.repeat(bytes);
var server = net.createServer(function(c) {
console.log('connected');