From 3481780e065d36159595baa3e97c41cb538f5f84 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 26 Dec 2018 22:13:04 -0800 Subject: [PATCH] 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 --- PKHeX.Core/Legality/Evolutions/EvolutionChain.cs | 4 ++-- PKHeX.Core/Legality/Evolutions/EvolutionLineage.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs b/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs index 0e9a8de2e..bb481f1cc 100644 --- a/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs +++ b/PKHeX.Core/Legality/Evolutions/EvolutionChain.cs @@ -236,7 +236,7 @@ internal static List GetValidPreEvolutions(PKM pkm, int maxspecieso lvl = pkm.CurrentLevel; if (pkm.IsEgg && !skipChecks) { - return new List + return new List(1) { new EvoCriteria { Species = pkm.Species, Level = lvl, MinLevel = lvl }, }; @@ -244,7 +244,7 @@ internal static List GetValidPreEvolutions(PKM pkm, int maxspecieso if (pkm.Species == 292 && lvl >= 20 && (!pkm.HasOriginalMetLocation || pkm.Met_Level + 1 <= lvl)) { - return new List + return new List(2) { new EvoCriteria { Species = 292, Level = lvl, MinLevel = 20 }, new EvoCriteria { Species = 290, Level = lvl, MinLevel = 1 } diff --git a/PKHeX.Core/Legality/Evolutions/EvolutionLineage.cs b/PKHeX.Core/Legality/Evolutions/EvolutionLineage.cs index a5ad40949..3bd7f79b8 100644 --- a/PKHeX.Core/Legality/Evolutions/EvolutionLineage.cs +++ b/PKHeX.Core/Legality/Evolutions/EvolutionLineage.cs @@ -34,7 +34,7 @@ public List 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 { first }; + var dl = new List(3) { first }; for (int i = Chain.Count - 1; i >= 0; i--) // reverse evolution! { bool oneValid = false;