Skip to content

Commit

Permalink
perf(setup): cache only opt table passed to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenEast committed Dec 27, 2022
1 parent b4aa477 commit ae5df67
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions lua/nightfox/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,12 @@ function M.setup(opts)

local git_path = util.join_paths(debug.getinfo(1).source:sub(2, -23), ".git", "ORIG_HEAD")
local git = vim.fn.getftime(git_path)
local hash = config.hash() .. override.hash() .. (git == -1 and git_path or git)
local hash = require("nightfox.lib.hash")(opts) .. (git == -1 and git_path or git)

if cached ~= hash then
M.compile()
write_file(cached_path, hash)
end

require("nightfox.util.deprecation").check_deprecation(opts)
end

return M
1 change: 0 additions & 1 deletion lua/nightfox/lib/hash.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
local bitop = bit or bit32 or require("nightfox.lib.native_bit")
local M = {}

-- https://theartincode.stanis.me/008-djb2/
local function djb2(s)
Expand Down

0 comments on commit ae5df67

Please sign in to comment.