Skip to content

Commit

Permalink
Return early from update_options()
Browse files Browse the repository at this point in the history
Instead of adding `or` switch with empty table to prevent errors,
just check if it present, and if not do nothing.
  • Loading branch information
monkoose committed Apr 26, 2022
1 parent 5ff5b00 commit 308dfed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/matchparen/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ local public_options = {
---Updates `options` table with values from `new`
---@param new table
local function update_options(new)
for option, value in pairs(new or {}) do
if not new then return end

for option, value in pairs(new) do
if vim.tbl_contains(public_options, option) then
options[option] = value
end
Expand Down

0 comments on commit 308dfed

Please sign in to comment.