mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
Misc profiling improvements
ResetBoxes reduce method calls for new blank/setting, just set data. 160ms->4ms ComboBox Validation calling SelectedText.Length=0 no longer needed 3y after it was originally added. 268ms->0ms speeds up main thread by a third of a second (wowww), but the selectedtext removal makes the program snappier during regular use (loading/modifying)
This commit is contained in:
parent
33359b1526
commit
529f8d1348
2 changed files with 6 additions and 2 deletions
|
@ -2817,7 +2817,6 @@ namespace PKHeX.WinForms
|
|||
if (cb == null)
|
||||
return;
|
||||
|
||||
cb.SelectionLength = 0;
|
||||
if (cb.Text == "")
|
||||
{ cb.SelectedIndex = 0; return; }
|
||||
if (cb.SelectedValue == null)
|
||||
|
|
|
@ -565,11 +565,16 @@ namespace PKHeX.Core
|
|||
{
|
||||
if (BoxEnd < 0)
|
||||
BoxEnd = BoxCount;
|
||||
|
||||
var blank = BlankPKM.EncryptedBoxData;
|
||||
if (this is SAV3RSBox)
|
||||
Array.Resize(ref blank, blank.Length + 4); // 00000 TID/SID at end
|
||||
|
||||
for (int i = BoxStart; i < BoxEnd; i++)
|
||||
{
|
||||
int offset = getBoxOffset(i);
|
||||
for (int p = 0; p < BoxSlotCount; p++)
|
||||
setStoredSlot(BlankPKM, offset + SIZE_STORED * p);
|
||||
setData(blank, offset + SIZE_STORED * p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue