Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Rewrite loop computing outside corners
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorkarn committed Aug 11, 2022
1 parent 12be2d9 commit 434071a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/sage/combinat/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -4030,12 +4030,9 @@ def outside_corners(self):
p = self
if p.is_empty():
return [(0,0)]
res = [ (0, p[0]) ]
for i in range(1, len(p)):
if p[i-1] != p[i]:
res.append((i,p[i]))
res = [(0, p[0])]
res.extend((n, j) for n, (i, j) in enumerate(zip(p[:-1], p[1:]), start=1) if i != j)
res.append((len(p), 0))

return res

addable_cells = outside_corners # for compatibility with partition tuples
Expand Down

0 comments on commit 434071a

Please sign in to comment.