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

Commit

Permalink
trac #30214: use enumerate and avoid creation of list
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoudert committed Aug 14, 2020
1 parent 08c3e05 commit 12cadec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sage/combinat/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,8 +1620,8 @@ def to_digraph(self):
sage: d.edges(labels=False)
[(1, 1)]
"""
E = [(i + 1, self[i]) for i in range(len(self))]
return DiGraph([self, E], format='vertices_and_edges', loops=True)
return DiGraph([self, enumerate(self, start=1)],
format='vertices_and_edges', loops=True)

def show(self, representation="cycles", orientation="landscape", **args):
r"""
Expand Down

0 comments on commit 12cadec

Please sign in to comment.