From 0eced8969b788a846fed0860708a26c857aa6674 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 5 Nov 2021 16:39:13 +0000 Subject: [PATCH] refactor: replaced loop for tbl_contains --- lua/harpoon/mark.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lua/harpoon/mark.lua b/lua/harpoon/mark.lua index 14817fe..6d7fd3d 100644 --- a/lua/harpoon/mark.lua +++ b/lua/harpoon/mark.lua @@ -125,16 +125,14 @@ local function filter_filetype() return end - for filetype = 1, #excluded_filetypes do - if current_filetype == excluded_filetypes[filetype] then - log.error( - 'filter_filetype(): This filetype cannot be added or is included in the "excluded_filetypes" option' - ) - error( - 'This filetype cannot be added or is included in the "excluded_filetypes" option' - ) - return - end + if vim.tbl_contains(excluded_filetypes, current_filetype) then + log.error( + 'filter_filetype(): This filetype cannot be added or is included in the "excluded_filetypes" option' + ) + error( + 'This filetype cannot be added or is included in the "excluded_filetypes" option' + ) + return end end