Remove unnecessary casts

This commit is contained in:
Kurt 2020-01-06 17:50:18 -08:00
parent c14c3b14e8
commit 0dd4d1fe7a
9 changed files with 10 additions and 9 deletions

View file

@ -55,7 +55,7 @@ namespace PKHeX.Core
{
return info switch
{
SlotInfoParty p => (SlotReversion) new PartyReversion(p, sav),
SlotInfoParty p => new PartyReversion(p, sav),
_ => new SingleSlotReversion(info, sav)
};
}

View file

@ -170,7 +170,7 @@ namespace PKHeX.Core
2 => ParsePK7,
7 => ParsePK7,
8 => (Action)ParsePK8,
8 => ParsePK8,
_ => throw new Exception()
};

View file

@ -373,7 +373,7 @@ namespace PKHeX.Core
6 => WildPokeballs6,
7 => (pkm.GG ? WildPokeballs7b : WildPokeballs7),
8 => WildPokeballs8,
_ => (ICollection<int>)Array.Empty<int>()
_ => Array.Empty<int>()
};
}
@ -431,7 +431,7 @@ namespace PKHeX.Core
3 => FutureEvolutionsGen3,
4 => FutureEvolutionsGen4,
5 => FutureEvolutionsGen5,
_ => (ICollection<int>)Array.Empty<int>()
_ => Array.Empty<int>()
};
}

View file

@ -150,7 +150,7 @@ namespace PKHeX.Core
{
return type switch
{
EncounterOrder.Egg => (IEnumerable<IEncounterable>)GetEggs(pk, needs, version),
EncounterOrder.Egg => GetEggs(pk, needs, version),
EncounterOrder.Mystery => GetGifts(pk, needs),
EncounterOrder.Static => GetStatic(pk, needs),
EncounterOrder.Trade => GetTrades(pk, needs),

View file

@ -275,7 +275,7 @@ namespace PKHeX.Core
6 => GetMovesLevelUp6(species, form, lvl, version),
7 => GetMovesLevelUp7(species, form, lvl, MoveReminder, version),
8 => GetMovesLevelUp8(species, form, lvl, version),
_ => (IEnumerable<int>)Array.Empty<int>()
_ => Array.Empty<int>()
};
}

View file

@ -108,7 +108,7 @@ namespace PKHeX.Core.Searching
return Clones switch
{
CloneDetectionMethod.HashPID => HashByPID,
_ => (Func<PKM, string>)HashByDetails,
_ => HashByDetails,
};
}

View file

@ -121,7 +121,7 @@ namespace PKHeX.Core
{
PokeCrypto.SIZE_3CSTORED => new CK3(data),
PokeCrypto.SIZE_3XSTORED => new XK3(data),
_ => (PKM)new PK3(data)
_ => new PK3(data)
};
case 4:
var pk = new PK4(data);

View file

@ -604,7 +604,7 @@ namespace PKHeX.WinForms.Controls
SAV7 s7 => new SAV_Trainer7(s7),
SAV7b b7 => new SAV_Trainer7GG(b7),
SAV8SWSH swsh => new SAV_Trainer8(swsh),
_ => (Form) new SAV_SimpleTrainer(sav)
_ => new SAV_SimpleTrainer(sav)
};
}

View file

@ -75,6 +75,7 @@ namespace PKHeX.Tests.Legality
legality.Valid.Should().BeTrue($"because the file '{fi.Directory.Name}\\{fi.Name}' should be invalid, but found:{Environment.NewLine}{msg}");
}
}
ctr.Should().BeGreaterThan(0);
}
}
}