mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-19 23:40:31 +00:00
Improve linter performance (#2083)
Only compute args if we are actually going to use it
This commit is contained in:
parent
b66ec2bf7a
commit
ee9c78dc86
1 changed files with 4 additions and 5 deletions
|
|
@ -123,12 +123,11 @@ function runLinter(buf)
|
|||
ftmatch = false
|
||||
end
|
||||
|
||||
local args = {}
|
||||
for k, arg in pairs(v.args) do
|
||||
args[k] = arg:gsub("%%f", file):gsub("%%d", dir)
|
||||
end
|
||||
|
||||
if ftmatch then
|
||||
local args = {}
|
||||
for k, arg in pairs(v.args) do
|
||||
args[k] = arg:gsub("%%f", file):gsub("%%d", dir)
|
||||
end
|
||||
lint(buf, k, v.cmd, args, v.errorformat, v.loffset, v.coffset, v.callback)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue