Fixes bad expressions, bad bool checks in loops, a few null pointer exceptions, and optimizes constructors.

This commit is contained in:
Kamron Batman 2018-09-15 23:16:45 -07:00
parent 8da55d6043
commit f93c3b992e
62 changed files with 318 additions and 634 deletions

View file

@ -340,16 +340,11 @@ namespace Server.Gumps
return Encoding.ASCII.GetBytes(str);
}
private Packet Compile()
{
return Compile(null);
}
private Packet Compile(NetState ns)
private Packet Compile(NetState ns = null)
{
IGumpWriter disp;
if (ns != null && ns.Unpack)
if (ns?.Unpack == true)
disp = new DisplayGumpPacked(this);
else
disp = new DisplayGumpFast(this);
@ -367,11 +362,10 @@ namespace Server.Gumps
disp.AppendLayout(m_NoResize);
int count = Entries.Count;
GumpEntry e;
for (int i = 0; i < count; ++i)
{
e = Entries[i];
GumpEntry e = Entries[i];
disp.AppendLayout(m_BeginLayout);
e.AppendTo(ns, disp);