Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed Nov 13, 2024
1 parent befbaf1 commit 96ec743
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libsast/core_matcher/choice_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def read_file_contents(self, paths: list) -> list:
# Scan only alternative path
scan_paths = [Path(self.alternative_path)]
choice_args.append((scan_paths, rule))
if not choice_args:
return []

# Use ThreadPoolExecutor for file reading
with ThreadPoolExecutor() as io_executor:
Expand Down
2 changes: 2 additions & 0 deletions libsast/core_matcher/pattern_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def read_file_contents(self, paths: list) -> list:
sfile for sfile in paths
if is_file_valid(sfile, self.exts, 5)
}
if not files_to_scan:
return []

# Use a ThreadPool for file reading
with ThreadPoolExecutor() as io_executor:
Expand Down

0 comments on commit 96ec743

Please sign in to comment.