mirror of
https://github.com/TangentFoxy/lume.git
synced 2026-03-14 12:46:51 -06:00
Made lume.reduce check initial value for nil instead of non-truthy
Fixes #32
This commit is contained in:
@@ -286,8 +286,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function lume.reduce(t, fn, first)
|
function lume.reduce(t, fn, first)
|
||||||
|
local started = first ~= nil
|
||||||
local acc = first
|
local acc = first
|
||||||
local started = first and true or false
|
|
||||||
local iter = getiter(t)
|
local iter = getiter(t)
|
||||||
for _, v in iter(t) do
|
for _, v in iter(t) do
|
||||||
if started then
|
if started then
|
||||||
|
|||||||
Reference in New Issue
Block a user