Don't waste alloc on clearing titlescreen slot

Revisiting #3098 #3086
This commit is contained in:
Kurt 2020-12-01 07:19:21 -08:00
parent 228042b111
commit e54e94a734
2 changed files with 6 additions and 2 deletions

View file

@ -30,7 +30,7 @@ namespace PKHeX.Core
for (int i = 0; i < party.Count; i++)
ViewPoke(i).LoadFrom(party[i]);
for (int i = party.Count; i < 6; i++)
ViewPoke(i).LoadFrom(new PK8());
ViewPoke(i).Clear();
}
}
@ -106,6 +106,8 @@ namespace PKHeX.Core
set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x24);
}
public void Clear() => Array.Clear(Data, Offset, SIZE);
public void LoadFrom(PKM pkm)
{
Species = pkm.Species;

View file

@ -245,7 +245,7 @@ namespace PKHeX.Core
for (int i = 0; i < party.Count; i++)
ViewPoke(i).LoadFrom(party[i]);
for (int i = party.Count; i < 6; i++)
ViewPoke(i).LoadFrom(new PK8());
ViewPoke(i).Clear();
}
public ushort Year
@ -328,6 +328,8 @@ namespace PKHeX.Core
set => BitConverter.GetBytes(value).CopyTo(Data, Offset + 0x18);
}
public void Clear() => Array.Clear(Data, Offset, SIZE);
public void LoadFrom(PKM pkm)
{
Species = pkm.Species;