Add initial sizes

maximum is always 3; sometimes we know the max size so specify.
bcl has default size = 0, which then resizes to 4 on first addition
wow such optimization
This commit is contained in:
Kurt 2018-12-26 22:13:04 -08:00
parent 988e71bec5
commit 3481780e06
2 changed files with 3 additions and 3 deletions

View File

@ -236,7 +236,7 @@ internal static List<EvoCriteria> GetValidPreEvolutions(PKM pkm, int maxspecieso
lvl = pkm.CurrentLevel;
if (pkm.IsEgg && !skipChecks)
{
return new List<EvoCriteria>
return new List<EvoCriteria>(1)
{
new EvoCriteria { Species = pkm.Species, Level = lvl, MinLevel = lvl },
};
@ -244,7 +244,7 @@ internal static List<EvoCriteria> GetValidPreEvolutions(PKM pkm, int maxspecieso
if (pkm.Species == 292 && lvl >= 20 && (!pkm.HasOriginalMetLocation || pkm.Met_Level + 1 <= lvl))
{
return new List<EvoCriteria>
return new List<EvoCriteria>(2)
{
new EvoCriteria { Species = 292, Level = lvl, MinLevel = 20 },
new EvoCriteria { Species = 290, Level = lvl, MinLevel = 1 }

View File

@ -34,7 +34,7 @@ public List<EvoCriteria> GetExplicitLineage(PKM pkm, int maxLevel, bool skipChec
{
int lvl = maxLevel;
var first = new EvoCriteria {Species = pkm.Species, Level = lvl, Form = pkm.AltForm};
var dl = new List<EvoCriteria> { first };
var dl = new List<EvoCriteria>(3) { first };
for (int i = Chain.Count - 1; i >= 0; i--) // reverse evolution!
{
bool oneValid = false;