From 79bbe5a38d0a8bee0e973cea82d939dd6f52de63 Mon Sep 17 00:00:00 2001 From: Holly Date: Wed, 23 Feb 2022 02:49:25 +0000 Subject: [PATCH] Remove all remaining new keywords from Buffer.alloc(s) --- Binato.js | 2 +- server/User.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Binato.js b/Binato.js index e29705f..b93063f 100644 --- a/Binato.js +++ b/Binato.js @@ -35,7 +35,7 @@ if (config.compression) { } else consoleHelper.printWarn("Gzip Compression is disabled!"); app.use((req, res) => { - req.packet = new Buffer.alloc(0); + req.packet = Buffer.alloc(0); req.on("data", (chunk) => req.packet = Buffer.concat([req.packet, chunk], req.packet.length + chunk.length)); req.on("end", () => { switch (req.method) { diff --git a/server/User.js b/server/User.js index f9cacb5..e27654c 100644 --- a/server/User.js +++ b/server/User.js @@ -6,7 +6,7 @@ module.exports = class { this.username = username; this.uuid = uuid; this.connectTime = connectTime; - this.queue = new Buffer.alloc(0); + this.queue = Buffer.alloc(0); // Binato specific this.rankingMode = 0; @@ -130,6 +130,6 @@ module.exports = class { // Clears out the user's queue clearQueue() { - this.queue = new Buffer.alloc(0); + this.queue = Buffer.alloc(0); } } \ No newline at end of file