Simplify deletion of expanded blossoms
This commit is contained in:
parent
a1836a585f
commit
fa524ce754
|
@ -1137,16 +1137,9 @@ class _MatchingContext:
|
||||||
|
|
||||||
# Delete the expanded blossoms.
|
# Delete the expanded blossoms.
|
||||||
# We do this in one pass over the array to ensure O(n) time.
|
# We do this in one pass over the array to ensure O(n) time.
|
||||||
p = 0
|
self.nontrivial_blossom = [blossom
|
||||||
for (i, blossom) in enumerate(self.nontrivial_blossom):
|
for blossom in self.nontrivial_blossom
|
||||||
if not blossom.marker:
|
if not blossom.marker]
|
||||||
# Keep this blossom.
|
|
||||||
if i > p:
|
|
||||||
self.nontrivial_blossom[p] = blossom
|
|
||||||
p += 1
|
|
||||||
|
|
||||||
# Trim the array.
|
|
||||||
del self.nontrivial_blossom[p:]
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Augmenting:
|
# Augmenting:
|
||||||
|
|
Loading…
Reference in New Issue