summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2011-07-18 21:46:08 +0800
committerJeremy Kerr <jk@ozlabs.org>2011-07-18 21:46:08 +0800
commit539b6596dc1bf1d3118631095625e354026da373 (patch)
tree82b6f1f96f452ee8cbc078a1448085ae3b1703aa /apps
parent85e391e7781464514b9df6e7b6936515c3db6c46 (diff)
downloadpatchwork-539b6596dc1bf1d3118631095625e354026da373.tar.bz2
patchwork-539b6596dc1bf1d3118631095625e354026da373.tar.xz
xmlrpc: do slice before patch_to_dict
Currently, we map patch_to_dict before we slice the results (to only return max_count patches). This means that we hacve to retrieve all patches, then throw away most of the results of the map. This change does the slice on the patches before the map, letting django do a LIMIT-ed query instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/patchwork/views/xmlrpc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/patchwork/views/xmlrpc.py b/apps/patchwork/views/xmlrpc.py
index bb9ebe1..283eb34 100644
--- a/apps/patchwork/views/xmlrpc.py
+++ b/apps/patchwork/views/xmlrpc.py
@@ -328,7 +328,7 @@ def patch_list(filter={}):
patches = Patch.objects.filter(**dfilter)
if max_count > 0:
- return map(patch_to_dict, patches)[:max_count]
+ return map(patch_to_dict, patches[:max_count])
else:
return map(patch_to_dict, patches)