Skip to content

Commit

Permalink
Slight speed up by skipping tiny regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
b-c-ds authored and bcaller committed Jan 13, 2021
1 parent 7283cf3 commit 2f7f5f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions regexploit/bin/regexploit_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def handle_line_from_node(line: str, output: TextOutput):
first_for_regex = True
regex = json.loads(line)
if pattern := regex.get("pattern"):
if len(pattern) < 5: # (.+)+
return
filename = regex["filename"]
lineno = regex["lineno"]
try:
Expand Down

0 comments on commit 2f7f5f8

Please sign in to comment.