fix: Cleans up some string allocations from trim (#1759)

This commit is contained in:
Kamron Batman 2024-05-03 22:43:11 -07:00 • committed by GitHub
parent 9d2f471e91
commit d77668d77a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 15 additions and 22 deletions

View file

@ -50,13 +50,7 @@ namespace Server.Gumps
var g = m_List[i];
string name;
if ((name = g.Name) != null && (name = name.Trim()).Length <= 0)
{
name = "(empty)";
}
string name = g.Name?.Trim().DefaultIfNullOrEmpty("(empty)");
AddLabel(radio ? 55 : 20, 35 + i % 11 * 30, 0, name);
}
}