mirror of
https://github.com/adulau/crl-monitor.git
synced 2024-12-23 01:06:02 +00:00
Improve regexp performance
This commit is contained in:
parent
65f283253e
commit
9ba1adc8f4
1 changed files with 5 additions and 2 deletions
|
@ -15,11 +15,14 @@ import OpenSSL
|
|||
cert = None
|
||||
certstring = ""
|
||||
|
||||
certtag = re.compile('^\s+Certificate\s*$')
|
||||
certtagend = re.compile('^\S+')
|
||||
|
||||
for l in fileinput.input():
|
||||
if re.match('^\s+Certificate\s*$', l):
|
||||
if certtag.match(l):
|
||||
cert = True
|
||||
continue
|
||||
elif re.match('^\S+', l):
|
||||
elif certtagend.match(l):
|
||||
cert = None
|
||||
|
||||
if (cert is True):
|
||||
|
|
Loading…
Reference in a new issue