summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-09 03:51:23 +0200
committerDan McGee <dan@archlinux.org>2012-07-09 04:06:52 +0200
commitb95b0cd4197d70831754a7e81b40388c37ab1a3d (patch)
tree39176139515c682a6e858ad5182012c67fbefd69 /packages
parentca86b8d339ff3b8e74ac6d2ccf8a14458a690cf5 (diff)
downloadarchweb-b95b0cd4197d70831754a7e81b40388c37ab1a3d.tar.gz
archweb-b95b0cd4197d70831754a7e81b40388c37ab1a3d.tar.xz
Use a set instead of list when gathering package IDs to fetch
If we have duplicates in this list, it makes no sense to include them in the list we send to the database. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/utils.py b/packages/utils.py
index 8231347..b86b6eb 100644
--- a/packages/utils.py
+++ b/packages/utils.py
@@ -123,7 +123,7 @@ SELECT p.id, q.id
cursor.execute(sql, [arch_a.id, arch_b.id])
results = cursor.fetchall()
# column A will always have a value, column B might be NULL
- to_fetch = [row[0] for row in results]
+ to_fetch = set(row[0] for row in results)
# fetch all of the necessary packages
pkgs = Package.objects.normal().in_bulk(to_fetch)
# now build a list of tuples containing differences