# HG changeset patch # User Paul Boddie # Date 1487864263 -3600 # Node ID d1d907801d42259dc2de1fd4dc3e6affe997a84e # Parent 2c1ae8f292a98cfdb78174717a99691553af85ee Replaced list comprehension usage. diff -r 2c1ae8f292a9 -r d1d907801d42 branching.py --- a/branching.py Wed Feb 22 17:19:02 2017 +0100 +++ b/branching.py Thu Feb 23 16:37:43 2017 +0100 @@ -4,7 +4,7 @@ Track attribute usage for names. Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, - 2014, 2015, 2016 Paul Boddie + 2014, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -75,7 +75,11 @@ if name in self.assignments: return [self] else: - return [b for b in self.get_all_suppliers(name) if name in b.assignments] + sources = [] + for b in self.get_all_suppliers(name): + if name in b.assignments: + sources.append(b) + return sources def set_usage(self, name, attrname, invocation=False, assignment=False): @@ -597,7 +601,10 @@ d = {} for name, branches in self.assignments.items(): - d[name] = [branch.values.get(name) for branch in branches] + l = [] + for branch in branches: + l.append(branch.values.get(name)) + d[name] = l return d # Special objects.