Skip to content

Commit

Permalink
fix: allow iterating weeks in listsync with unknown entries
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Dec 31, 2021
1 parent f9899ad commit 81c59cc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions source/ListSync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,15 @@ local function weekEntryIterator(listSync, week)
search:setCounter(-1 * math.huge)

local position = sortedList:searchGreaterThanOrEqual(search)
local stateManager = listSync._stateManager
local entries = sortedList:entries()

return function()
-- luacheck: push ignore
while position ~= nil and position <= #entries do
-- luacheck: pop ignore
local entry = entries[position]
stateManager:castLogEntry(entry)
position = position + 1
if entry:weekNumber() == week then
if LogEntry.weekNumber(entry) == week then
return entry
else
return nil
Expand Down

0 comments on commit 81c59cc

Please sign in to comment.