perf: 修改 port (#10049)

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2023-03-23 14:13:08 +08:00
committed by GitHub
parent 3b45ad0c61
commit 166d074adb
2 changed files with 11 additions and 11 deletions

View File

@@ -101,15 +101,8 @@ class JMSInventory:
@staticmethod
def get_primary_protocol(protocols):
primary_protocol = [p for p in protocols if p.primary]
if len(primary_protocol) >= 1:
primary = primary_protocol[0]
elif protocols:
if protocols:
primary = protocols[0]
else:
primary = None
if primary:
protocol = primary.name
port = primary.port
else: