Skip to content

Commit

Permalink
perf: avoid unnecessary lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Dec 21, 2024
1 parent 1dc2def commit b586eec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/cord/activity/manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,17 @@ function ActivityManager.new(opts, callback)
ws_utils.find(rawdir, function(dir)
dir = dir or cwd
self.workspace_dir = dir
self.workspace_cache[rawdir] = {

local cache = {
dir = dir,
name = vim.fn.fnamemodify(dir, ':t'),
}

ws_utils.find_git_repository(dir, function(repo_url)
self.repo_url = repo_url
self.workspace_cache[rawdir].repo_url = repo_url
cache.repo_url = repo_url

self.workspace_cache[rawdir] = cache

callback(self)
end)
Expand Down

0 comments on commit b586eec

Please sign in to comment.