vet: optimize performance for path detection, when vetting files (#21139)

This commit is contained in:
Turiiya 2024-03-29 18:28:18 +01:00 committed by GitHub
parent 030a85c2d0
commit a015824eef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,14 +64,11 @@ fn main() {
}
if os.is_dir(path) {
vt.vprintln("vetting folder: '${path}' ...")
vfiles := os.walk_ext(path, '.v')
vvfiles := os.walk_ext(path, '.vv')
mut files := []string{}
files << vfiles
files << vvfiles
for file in files {
vt.vet_file(file)
}
os.walk(path, fn [mut vt] (p string) {
if p.ends_with('.v') || p.ends_with('.vv') {
vt.vet_file(p)
}
})
}
}
vfmt_err_count := vt.errors.filter(it.fix == .vfmt).len