mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-12-22 04:32:18 +01:00
Apply fixes from fixit
RewriteToLiteral: It's slower to call list() than using the empty literal
This commit is contained in:
parent
24f90df13e
commit
e70a7a9675
@ -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.
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user