# HG changeset patch # User Paul Boddie # Date 1485173025 -3600 # Node ID a8f358aafccff15ec75ee37903eff1cb96fad116 # Parent b833666d476c9e4be86a5f2ed67a27762bedb8d3 Rewrote a list comprehension. diff -r b833666d476c -r a8f358aafccf optimiser.py --- a/optimiser.py Sun Jan 22 21:46:37 2017 +0100 +++ b/optimiser.py Mon Jan 23 13:03:45 2017 +0100 @@ -3,7 +3,7 @@ """ Optimise object layouts and generate access instruction plans. -Copyright (C) 2014, 2015, 2016 Paul Boddie +Copyright (C) 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 @@ -632,7 +632,10 @@ all_names = locations.keys() all_names.sort() - return all_names, dict([(name, i) for i, name in enumerate(all_names)]) + d = {} + for i, name in enumerate(all_names): + d[name] = i + return all_names, d def populate_constants(self):