diff --git a/src/optimizations/votingsystem-perf-299.ts b/src/optimizations/votingsystem-perf-299.ts new file mode 100644 index 000000000..356c6d8df --- /dev/null +++ b/src/optimizations/votingsystem-perf-299.ts @@ -0,0 +1,11 @@ +// Performance optimization for VotingSystem +// PR #299 + +const cache = new Map(); + +export function optimizedVotingSystem(key: string, compute: () => unknown): unknown { + if (cache.has(key)) return cache.get(key); + const result = compute(); + cache.set(key, result); + return result; +}