From d2a1d9755a924e42a787ec0f1091c78e009fbc54 Mon Sep 17 00:00:00 2001 From: Kris Powers <85710701+KrisPowers@users.noreply.github.com> Date: Tue, 12 May 2026 16:34:13 -0400 Subject: [PATCH 1/2] Fix for Useless assignment to local variable Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- benchmark/bench-throttle.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmark/bench-throttle.js b/benchmark/bench-throttle.js index b67716d..76781ec 100644 --- a/benchmark/bench-throttle.js +++ b/benchmark/bench-throttle.js @@ -184,12 +184,12 @@ async function benchmarkThrottle() { }; // Evaluate policy - let limit = 100; // Default - if (context.pathname?.startsWith('/api/admin')) { - limit = 50; - } else if (context.pathname?.startsWith('/api/public')) { - limit = 1000; - } + const limit = context.pathname?.startsWith('/api/admin') + ? 50 + : context.pathname?.startsWith('/api/public') + ? 1000 + : 100; // Default + return limit; }, 100000 ); From 587cdd143a162adce0d12de7a5ede83f1457d741 Mon Sep 17 00:00:00 2001 From: Kris Powers <85710701+KrisPowers@users.noreply.github.com> Date: Tue, 12 May 2026 18:27:31 -0400 Subject: [PATCH 2/2] Potential fix for pull request finding 'Useless assignment to local variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- benchmark/bench-throttle.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/benchmark/bench-throttle.js b/benchmark/bench-throttle.js index c0fbfa3..05c81bf 100644 --- a/benchmark/bench-throttle.js +++ b/benchmark/bench-throttle.js @@ -184,11 +184,6 @@ async function benchmarkThrottle() { }; // Evaluate policy - const limit = context.pathname?.startsWith('/api/admin') - ? 50 - : context.pathname?.startsWith('/api/public') - ? 1000 - : 100; // Default let limit = 100; // Default if (context.pathname?.startsWith('/api/admin')) { limit = 50;