From 49aaebdd20c3813891cf5ae9c8daba7f0e7ca69b Mon Sep 17 00:00:00 2001 From: jaysunxiao Date: Mon, 16 May 2022 21:00:00 +0800 Subject: [PATCH] =?UTF-8?q?perf[protocol]:=20=E4=BD=BF=E7=94=A8=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=94=9F=E6=88=90=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/js/ProtocolManagerTemplate.js | 6 ++-- .../src/main/resources/js/ProtocolTemplate.js | 29 +++++-------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/protocol/src/main/resources/js/ProtocolManagerTemplate.js b/protocol/src/main/resources/js/ProtocolManagerTemplate.js index db282e69..cb1b633b 100644 --- a/protocol/src/main/resources/js/ProtocolManagerTemplate.js +++ b/protocol/src/main/resources/js/ProtocolManagerTemplate.js @@ -1,5 +1,4 @@ -{ -} +{} const protocols = new Map(); @@ -28,8 +27,7 @@ ProtocolManager.read = function read(buffer) { }; ProtocolManager.initProtocol = function initProtocol() { - { - } + {} }; export default ProtocolManager; diff --git a/protocol/src/main/resources/js/ProtocolTemplate.js b/protocol/src/main/resources/js/ProtocolTemplate.js index 74bdea9a..6791801d 100644 --- a/protocol/src/main/resources/js/ProtocolTemplate.js +++ b/protocol/src/main/resources/js/ProtocolTemplate.js @@ -1,38 +1,25 @@ -{ -} -const {} = function ({}) { - { - } +{} +const {} = function({}) { + {} }; -{ -} -. -prototype.protocolId = function () { +{}.prototype.protocolId = function() { return {}; }; -{ -} -. -write = function (buffer, packet) { +{}.write = function(buffer, packet) { if (buffer.writePacketFlag(packet)) { return; } - { - } + {} }; -{ -} -. -read = function (buffer) { +{}.read = function(buffer) { if (!buffer.readBoolean()) { return null; } const packet = new {}(); - { - } + {} return packet; };