mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
Pre-compile more regexes
This commit is contained in:
parent
7e28e0ed90
commit
71a5eac494
2 changed files with 8 additions and 8 deletions
|
|
@ -380,7 +380,7 @@ def has_extension(filename, ext):
|
|||
return ext == f_ext
|
||||
|
||||
|
||||
apk_regex = None
|
||||
apk_regex = re.compile(r"^(.+)_([0-9]+)\.apk$")
|
||||
|
||||
|
||||
def clean_description(description):
|
||||
|
|
@ -397,10 +397,7 @@ def clean_description(description):
|
|||
|
||||
|
||||
def apknameinfo(filename):
|
||||
global apk_regex
|
||||
filename = os.path.basename(filename)
|
||||
if apk_regex is None:
|
||||
apk_regex = re.compile(r"^(.+)_([0-9]+)\.apk$")
|
||||
m = apk_regex.match(filename)
|
||||
try:
|
||||
result = (m.group(1), m.group(2))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue