From 65e274dcb6dc58990e60af892be941c6b53f195a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 5 Jul 2011 09:43:36 -0500 Subject: Simplify package differences code Signed-off-by: Dan McGee --- packages/utils.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/utils.py b/packages/utils.py index af4675bb..37f23244 100644 --- a/packages/utils.py +++ b/packages/utils.py @@ -92,21 +92,16 @@ SELECT p.id, q.id WHERE p.arch_id IN (%s, %s) AND ( q.id IS NULL - OR - p.pkgver != q.pkgver - OR - p.pkgrel != q.pkgrel - OR - p.epoch != q.epoch + OR p.pkgver != q.pkgver + OR p.pkgrel != q.pkgrel + OR p.epoch != q.epoch ) """ cursor = connection.cursor() cursor.execute(sql, [arch_a.id, arch_b.id]) results = cursor.fetchall() - to_fetch = [] - for row in results: - # column A will always have a value, column B might be NULL - to_fetch.append(row[0]) + # column A will always have a value, column B might be NULL + to_fetch = [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 -- cgit v1.2.3-55-g3dc8