Skip to content

Commit

Permalink
tools: reduce number of os/fs calls done by v where; ignore tests/ …
Browse files Browse the repository at this point in the history
…folders
  • Loading branch information
spytheman committed Aug 10, 2024
1 parent 2875086 commit 9d61a91
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/tools/vwhere/finder_utils.v
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,17 @@ fn collect_v_files(path string, recursive bool) ![]string {
if entry == '.git' {
continue
}
if entry == 'tests' {
continue
}
file := os.join_path_single(path, entry)
if os.is_dir(file) && !os.is_link(file) && recursive {
all_files << collect_v_files(file, recursive)!
} else if os.exists(file) && (file.ends_with('.v') || file.ends_with('.vsh')) {
if os.file_ext(entry) in ['.v', '.vsh'] {
all_files << file
continue
}
if recursive && os.is_dir(file) && !os.is_link(file) {
all_files << collect_v_files(file, recursive)!
continue
}
}
return all_files
Expand Down

0 comments on commit 9d61a91

Please sign in to comment.