Skip to content

Commit

Permalink
refactor: remove redundant ~= nil checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Dec 18, 2024
1 parent 33ae1c2 commit d760a7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 2 additions & 6 deletions lua/rocks/operations/handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ function handlers.get_install_handler_callback(rocks_toml_ref, arg_list)
local get_callback = handler.get_install_callback
return type(get_callback) == "function" and get_callback(rocks_toml_ref, arg_list)
end)
:find(function(callback)
return callback ~= nil
end)
:next()
end

---@param spec RockSpec
Expand All @@ -60,9 +58,7 @@ function handlers.get_sync_handler_callback(spec)
---@cast handler RockHandler
return handler.get_sync_callback(spec)
end)
:find(function(callback)
return callback ~= nil
end)
:next()
end

---@overload fun(rocks_toml_ref: MultiMutRocksTomlWrapper): rock_handler_callback[]
Expand Down
3 changes: 0 additions & 3 deletions lua/rocks/operations/sync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ operations.sync = function(user_rocks, on_complete)
:map(function(rock_name)
return user_rocks[rock_name]
end)
:filter(function(rock_spec)
return rock_spec ~= nil
end)
:each(function(rock_spec)
helpers.dynamic_load(rock_spec).wait()
end)
Expand Down

0 comments on commit d760a7f

Please sign in to comment.