[tor-commits] [pluggable-transports/snowflake-webext] 05/08: refactor: replace some `function`s with arrow functions

gitolite role git at cupani.torproject.org
Wed Jul 6 09:01:44 UTC 2022


This is an automated email from the git hooks/post-receive script.

meskio pushed a commit to branch main
in repository pluggable-transports/snowflake-webext.

commit 277cfc75e2ac6d2d2af28f4496d66c01f7f9db75
Author: WofWca <wofwca at protonmail.com>
AuthorDate: Sat Jun 18 19:04:35 2022 +0300

    refactor: replace some `function`s with arrow functions
---
 init-badge.js  | 4 +---
 init-webext.js | 4 +---
 snowflake.js   | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/init-badge.js b/init-badge.js
index f4dd7ff..c74038c 100644
--- a/init-badge.js
+++ b/init-badge.js
@@ -67,9 +67,7 @@ class BadgeUI extends UI {
     } else {
       this.setIcon('on');
     }
-    const total = this.stats.reduce((function(t, c) {
-      return t + c;
-    }), 0);
+    const total = this.stats.reduce((t, c) => t + c, 0);
     this.popup.turnOn(this.clients, total);
   }
 
diff --git a/init-webext.js b/init-webext.js
index 6c13e7f..dd67b98 100644
--- a/init-webext.js
+++ b/init-webext.js
@@ -77,9 +77,7 @@ class WebExtUI extends UI {
     if (!this.port) { return; }
     this.port.postMessage({
       clients: this.clients,
-      total: this.stats.reduce((function(t, c) {
-        return t + c;
-      }), 0),
+      total: this.stats.reduce((t, c) => t + c, 0),
       enabled: this.enabled,
       missingFeature: this.missingFeature,
     });
diff --git a/snowflake.js b/snowflake.js
index 2c94cf8..fcd91c5 100644
--- a/snowflake.js
+++ b/snowflake.js
@@ -174,9 +174,7 @@ class Snowflake {
     const pair = new ProxyPair(this.relayAddr, this.rateLimit, this.config);
     this.proxyPairs.push(pair);
 
-    log('Snowflake IDs: ' + (this.proxyPairs.map(function (p) {
-      return p.id;
-    })).join(' | '));
+    log('Snowflake IDs: ' + (this.proxyPairs.map(p => p.id)).join(' | '));
 
     pair.onCleanup = () => {
       // Delete from the list of proxy pairs.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list