Skip to content

Commit

Permalink
perf: limit number of regex results per file
Browse files Browse the repository at this point in the history
  • Loading branch information
kantord committed Aug 9, 2023
1 parent dacb96d commit 13bec2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion seagoat/sources/ripgrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def _fetch(query_text: str, path: str, limit: int):
query_text = re.sub(r"\s+", "|", query_text)
files = {}
for result in Ripgrepy(query_text, path).json().run().as_dict:
for result in Ripgrepy(query_text, path).max_count(limit).json().run().as_dict:
result_data = result["data"]
absolute_path = result_data["path"]["text"]
relative_path = Path(absolute_path).relative_to(path)
Expand Down

0 comments on commit 13bec2a

Please sign in to comment.