From dc58cf56bd9e1e3e76d3c23fbfb3088f792fc97d Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Tue, 10 Sep 2024 23:08:35 -0500 Subject: [PATCH] Satisfy linter --- lua/src/lib/primes.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/src/lib/primes.lua b/lua/src/lib/primes.lua index ce238bc9..8fc90eb2 100644 --- a/lua/src/lib/primes.lua +++ b/lua/src/lib/primes.lua @@ -1,9 +1,14 @@ local function primes(stop) local prime = 1 - local candidate + local candidate = 2 local sieve = {} local function next() + if stop ~= nil and candidate > stop + then + return nil + end + while true do candidate = prime + 1