mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Remove eager check of Current
The SaveUtil's ienumerable can be of different collection types, and the result is usually is a collection with >0 count I think I was initially confused (years and years ago) about "MoveNext" if it discarded the first result. Remove the eager check of the enumerator's current value because it hasn't yet been moved from the uninitialized state. Closes #3871 Dispose of the enumerator on the early empty return, since the later async code will dispose once all have been iterated.
This commit is contained in:
parent
d4d353c087
commit
583a036d65
1 changed files with 3 additions and 3 deletions
|
@ -262,10 +262,10 @@ public partial class SAV_FolderList : Form
|
|||
var list = new SaveList<SavePreview>();
|
||||
|
||||
var enumerator = saves.GetEnumerator();
|
||||
while (enumerator.Current == null)
|
||||
if (!enumerator.MoveNext())
|
||||
{
|
||||
if (!enumerator.MoveNext())
|
||||
return list;
|
||||
enumerator.Dispose();
|
||||
return list;
|
||||
}
|
||||
|
||||
var first = enumerator.Current;
|
||||
|
|
Loading…
Add table
Reference in a new issue