Commit bd6ec4b4 authored by peastman's avatar peastman
Browse files

Very minor optimization

parent ffc96cc6
......@@ -444,7 +444,7 @@ class Modeller(object):
lowerBound = center-box/2
upperBound = center+box/2
distToEdge = [min(min(pos-lowerBound), min(upperBound-pos)) for index, pos in addedWaters]
distToEdge = (min(min(pos-lowerBound), min(upperBound-pos)) for index, pos in addedWaters)
sortedIndex = [i[0] for i in sorted(enumerate(distToEdge), key=lambda x: -x[1])]
addedWaters = [addedWaters[i] for i in sortedIndex[:numAdded]]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment