mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
metadata: slightly speed up post_metadata_parse
Iterating over all the fields and checking which are modified is slower than just iterating over the modified ones.
This commit is contained in:
parent
7f6276889e
commit
d98b4d1b83
1 changed files with 4 additions and 7 deletions
|
@ -842,17 +842,14 @@ esc_newlines = re.compile(r'\\( |\n)')
|
|||
# This function uses __dict__ to be faster
|
||||
def post_metadata_parse(app):
|
||||
|
||||
for k, v in app.__dict__.items():
|
||||
if k not in app._modified:
|
||||
continue
|
||||
for k in app._modified:
|
||||
v = app.__dict__[k]
|
||||
if type(v) in (float, int):
|
||||
app.__dict__[k] = str(v)
|
||||
|
||||
for build in app.builds:
|
||||
for k, v in build.__dict__.items():
|
||||
|
||||
if k not in build._modified:
|
||||
continue
|
||||
for k in build._modified:
|
||||
v = build.__dict__[k]
|
||||
if type(v) in (float, int):
|
||||
build.__dict__[k] = str(v)
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue