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

Commit

Permalink
18119: Refactor is_injective
Browse files Browse the repository at this point in the history
  • Loading branch information
mrejmon committed Apr 22, 2021
1 parent 0e6e552 commit ab5c0c9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/sage/combinat/words/morphism.py
Expand Up @@ -3209,18 +3209,18 @@ def check(u, v):
tails.add(tail)
todo.append(tail)

images = self._morph.values()
images = self.images()
if any(not x for x in images):
return False
tails = set()
todo = []

for i, u in enumerate(images):
for j, v in enumerate(images):
if i == j:
continue
check(u, v)

for i in range(len(images)):
for j in range(i + 1, len(images)):
if images[i] == images[j]:
return False
check(images[i], images[j])
check(images[j], images[i])
while todo:
u = todo.pop()
for v in images:
Expand Down

0 comments on commit ab5c0c9

Please sign in to comment.