Skip to content

Commit

Permalink
refactor: remove inserted from info table of EntryManager
Browse files Browse the repository at this point in the history
  • Loading branch information
l-kershaw committed Jul 10, 2021
1 parent bac04ea commit 846e0ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions lua/telescope/entry_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ EntryManager.__index = EntryManager
---@param set_entry function: handler function for object using the EntryManager
---@param info table: (optional) table containing information to keep track of
--- @key looped number: number of existing entries checked when adding new entries
--- @key inserted number: TODO: figure out if this is used anywhere
--- @key find_loop number: number of entries checked when trying to find an entry
---@return any
function EntryManager:new(max_results, set_entry, info)
log.trace("Creating entry_manager...")

info = info or {}
info.looped = 0
info.inserted = 0
info.find_loop = 0

-- state contains list of
Expand Down Expand Up @@ -136,7 +134,7 @@ end
---@param new_container table: the container to be inserted into the linked list
function EntryManager:_insert_container_before(picker, index, linked_node, new_container)
self.linked_states:place_before(index, linked_node, new_container)
self.set_entry(picker, index, new_container[1], new_container[2], true)
self.set_entry(picker, index, new_container[1], new_container[2])

self:_update_score_from_tracked()
end
Expand All @@ -150,7 +148,7 @@ end
---@param new_container table: the container to be inserted into the linked list
function EntryManager:_insert_container_after(picker, index, linked_node, new_container)
self.linked_states:place_after(index, linked_node, new_container)
self.set_entry(picker, index, new_container[1], new_container[2], true)
self.set_entry(picker, index, new_container[1], new_container[2])

self:_update_score_from_tracked()
end
Expand Down
3 changes: 1 addition & 2 deletions lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,7 @@ end
--- Handler for when entries are added by `self.manager`
---@param index number: the index to add the entry at
---@param entry table: the entry that has been added to the manager
---@param insert boolean: whether the entry has been "inserted" or not
function Picker:entry_adder(index, entry, _, insert)
function Picker:entry_adder(index, entry)
if not entry then return end

local row = self:get_row(index)
Expand Down
1 change: 0 additions & 1 deletion lua/tests/manual/find_and_sort_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ local info_to_csv = function(info, filename)
writer:write(info.looped .. "\t")
writer:write(info.filtered .. "\t")
writer:write(info.added .. "\t")
writer:write(info.inserted .. "\t")
writer:write(info.total .. "\t")
writer:write(info.set_entry .. "\t")
writer:write(string.format("%.0f", collectgarbage("count")) .. "\t")
Expand Down

0 comments on commit 846e0ee

Please sign in to comment.