Performance improvement for store_offset(), partial fix for #188

This commit is contained in:
Roland Synnestvedt 2022-11-19 13:14:14 -08:00 committed by Roland Synnestvedt
parent 4dfe94e633
commit 0e414fdd5f

View file

@ -150,8 +150,9 @@ function M.get_index_of(item)
if type(item) == "string" then
local relative_item = utils.normalize_path(item)
local marks = harpoon.get_mark_config().marks
for idx = 1, M.get_length() do
if M.get_marked_file_name(idx) == relative_item then
if marks[idx] and marks[idx].filename == relative_item then
return idx
end
end