From cfd458ffbd38a00d1a97b84ee4f42dafeccb0607 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sun, 29 Nov 2020 17:49:42 +0800 Subject: [PATCH] feat: keep server remark empty --- Netch/Models/Server.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Netch/Models/Server.cs b/Netch/Models/Server.cs index d8ba9ccf..0041182d 100644 --- a/Netch/Models/Server.cs +++ b/Netch/Models/Server.cs @@ -47,14 +47,12 @@ namespace Netch.Models /// 备注 public override string ToString() { - if (string.IsNullOrWhiteSpace(Remark)) - { - Remark = $"{Hostname}:{Port}"; - } + var remark = string.IsNullOrWhiteSpace(Remark) ? $"{Hostname}:{Port}" : Remark; - Group = Group.Equals("None") || Group.Equals("") ? "NONE" : Group; + if (Group.Equals("None") || Group.Equals("")) + Group = "NONE"; - return $"[{ServerHelper.GetUtilByTypeName(Type)?.ShortName ?? "WTF"}][{Group}] {Remark}"; + return $"[{ServerHelper.GetUtilByTypeName(Type)?.ShortName ?? "WTF"}][{Group}] {remark}"; } public object Clone()