Skip to content

Commit e70a7a9

Browse files
committed
Apply fixes from fixit
RewriteToLiteral: It's slower to call list() than using the empty literal
1 parent 24f90df commit e70a7a9

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

dspace_statistics_api/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def on_get(self, req, resp):
9090
)
9191

9292
# create a list to hold dicts of stats
93-
statistics = list()
93+
statistics = []
9494

9595
# iterate over results and build statistics object
9696
for result in cursor:
@@ -162,7 +162,7 @@ def on_post(self, req, resp):
162162
)
163163

164164
# create a list to hold dicts of stats
165-
statistics = list()
165+
statistics = []
166166

167167
# iterate over views dict to extract views and use the element id as an
168168
# index to the downloads dict to extract downloads.

dspace_statistics_api/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def validate_post_parameters(req, resp, resource, params):
140140
description=f'The "{req.context.statistics_scope}" parameter is invalid. The value must be a comma-separated list of UUIDs.',
141141
)
142142
else:
143-
req.context.elements = list()
143+
req.context.elements = []
144144

145145

146146
def set_statistics_scope(req, resp, resource, params):

0 commit comments

Comments
 (0)