perf: improving get-random-game performance

This commit is contained in:
Chubby Granny Chaser 2024-06-03 16:56:12 +01:00
parent 467ea29ec2
commit c6242fa3e1
No known key found for this signature in database
2 changed files with 5 additions and 8 deletions

View file

@ -23,7 +23,9 @@ export const setRepacks = (repacks: GameRepack[]) => {
};
export const search = (options: flexSearch.SearchOptions) =>
repacksIndex.search(options).map((index) => state.repacks[index]);
repacksIndex
.search({ ...options, query: formatName(options.query ?? "") })
.map((index) => state.repacks[index]);
export const list = () => state.repacks;