1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-21 13:55:02 +01:00

Apply fixes from fixit

RewriteToLiteral: It's slower to call list() than using the empty literal
This commit is contained in:
Alan Orth 2023-12-09 12:33:46 +03:00
parent 24f90df13e
commit e70a7a9675
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ class AllStatisticsResource:
)
# create a list to hold dicts of stats
statistics = list()
statistics = []
# iterate over results and build statistics object
for result in cursor:
@ -162,7 +162,7 @@ class AllStatisticsResource:
)
# create a list to hold dicts of stats
statistics = list()
statistics = []
# iterate over views dict to extract views and use the element id as an
# index to the downloads dict to extract downloads.

View File

@ -140,7 +140,7 @@ def validate_post_parameters(req, resp, resource, params):
description=f'The "{req.context.statistics_scope}" parameter is invalid. The value must be a comma-separated list of UUIDs.',
)
else:
req.context.elements = list()
req.context.elements = []
def set_statistics_scope(req, resp, resource, params):