From 2843aa4189b518cda3cf3d7db2a6367e793e3938 Mon Sep 17 00:00:00 2001 From: larry-the-table-guy <180724454+larry-the-table-guy@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:25:12 -0400 Subject: [PATCH] Sim/teams: Don't redundantly call `toID` --- sim/teams.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sim/teams.ts b/sim/teams.ts index 1c0b8d91e405..67536e1ade3f 100644 --- a/sim/teams.ts +++ b/sim/teams.ts @@ -618,13 +618,14 @@ export const Teams = new class Teams { getGenerator(format: Format | string, seed: PRNG | PRNGSeed | null = null) { let TeamGenerator; format = Dex.formats.get(format); - if (toID(format).includes('gen9computergeneratedteams')) { + const formatID = toID(format); + if (formatID.includes('gen9computergeneratedteams')) { TeamGenerator = require(Dex.forFormat(format).dataDir + '/cg-teams').default; - } else if (toID(format).includes('gen9superstaffbrosultimate')) { + } else if (formatID.includes('gen9superstaffbrosultimate')) { TeamGenerator = require(`../data/mods/gen9ssb/random-teams`).default; - } else if (toID(format).includes('gen9babyrandombattle')) { + } else if (formatID.includes('gen9babyrandombattle')) { TeamGenerator = require(`../data/random-battles/gen9baby/teams`).default; - } else if (toID(format).includes('gen9randombattle') && format.ruleTable?.has('+pokemontag:cap')) { + } else if (formatID.includes('gen9randombattle') && format.ruleTable?.has('+pokemontag:cap')) { TeamGenerator = require(`../data/random-battles/gen9cap/teams`).default; } else { TeamGenerator = require(`../data/random-battles/${format.mod}/teams`).default;