Skip to content

Commit

Permalink
Merge pull request #4 from sqids/remove-unused-var
Browse files Browse the repository at this point in the history
Remove unused var inRangeNumbers
  • Loading branch information
nascarsayan authored Aug 19, 2024
2 parents be93915 + eca0e83 commit 5bed5eb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sqids.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,9 @@ function Sqids:encode(numbers)
return ''
end

-- don't allow out-of-range numbers [might be lang-specific]
local inRangeNumbers = {}
-- don't allow out-of-range numbers
for _, n in ipairs(numbers) do
if n >= 0 and n <= maxValue() then
table.insert(inRangeNumbers, n)
else
if n < 0 or n > maxValue() then
error("Encoding supports numbers between 0 and " .. maxValue())
end
end
Expand Down

0 comments on commit 5bed5eb

Please sign in to comment.