mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 16:48:01 +00:00
Minor tweak
don't allocate byte array, just set directly
This commit is contained in:
parent
c24851129f
commit
546ff01e5e
1 changed files with 3 additions and 3 deletions
|
@ -119,7 +119,6 @@ namespace PKHeX.WinForms
|
||||||
private void B_Save_Click(object sender, EventArgs e)
|
private void B_Save_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
// Copy Bags
|
// Copy Bags
|
||||||
byte[] bagarray = new byte[12];
|
|
||||||
int emptyslots = 0;
|
int emptyslots = 0;
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
{
|
{
|
||||||
|
@ -129,14 +128,15 @@ namespace PKHeX.WinForms
|
||||||
emptyslots++;
|
emptyslots++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
bagarray[i - emptyslots] = (byte)Array.IndexOf(trba, bag);
|
STB.SetBag(i - emptyslots, (byte)Array.IndexOf(trba, bag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (float.TryParse(TB_Time1.Text, out var t1))
|
if (float.TryParse(TB_Time1.Text, out var t1))
|
||||||
SAV.SetData(BitConverter.GetBytes(t1), offsetTime + (4 * 30));
|
SAV.SetData(BitConverter.GetBytes(t1), offsetTime + (4 * 30));
|
||||||
if (float.TryParse(TB_Time2.Text, out var t2))
|
if (float.TryParse(TB_Time2.Text, out var t2))
|
||||||
SAV.SetData(BitConverter.GetBytes(t2), offsetTime + (4 * 31));
|
SAV.SetData(BitConverter.GetBytes(t2), offsetTime + (4 * 31));
|
||||||
SAV.SetData(BitConverter.GetBytes((ushort)WinFormsUtil.GetIndex(CB_S2)), offsetSpec + (4 * 30));
|
SAV.SetData(BitConverter.GetBytes((ushort)WinFormsUtil.GetIndex(CB_S2)), offsetSpec + (4 * 30));
|
||||||
STB.Bags = bagarray;
|
|
||||||
Origin.CopyChangesFrom(SAV);
|
Origin.CopyChangesFrom(SAV);
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue