From 3ee2bfce9a896bb0a41327c260d322f6df073c60 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 23 Feb 2023 15:58:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=20(#9716)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ibuler --- apps/terminal/connect_methods.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/terminal/connect_methods.py b/apps/terminal/connect_methods.py index 10ecdfab5..944439ff1 100644 --- a/apps/terminal/connect_methods.py +++ b/apps/terminal/connect_methods.py @@ -148,7 +148,7 @@ class AppletMethod: class ConnectMethodUtil: - _all_methods = None + _all_methods = {} @classmethod def protocols(cls): @@ -210,7 +210,7 @@ class ConnectMethodUtil: @classmethod def refresh_methods(cls): - cls._all_methods = None + cls._all_methods = {} @classmethod def get_filtered_protocols_connect_methods(cls, os): @@ -245,8 +245,8 @@ class ConnectMethodUtil: @classmethod def get_protocols_connect_methods(cls, os): - if cls._all_methods is not None: - return cls._all_methods + if cls._all_methods.get('os'): + return cls._all_methods['os'] methods = defaultdict(list) web_methods = WebMethod.get_methods() @@ -298,5 +298,5 @@ class ConnectMethodUtil: method['component'] = TerminalType.tinker.value methods[protocol].extend(applet_methods) - cls._all_methods = methods + cls._all_methods[os] = methods return methods