diff --git a/gap/oper.gi b/gap/oper.gi index e1231fa88..39659fa0a 100644 --- a/gap/oper.gi +++ b/gap/oper.gi @@ -665,15 +665,19 @@ end); InstallMethod(OnDigraphs, "for a mutable digraph by out-neighbours and a perm", [IsMutableDigraph and IsDigraphByOutNeighboursRep, IsPerm], function(D, p) - local out; - if ForAll(DigraphVertices(D), i -> i ^ p = i) then + local out, permed; + if p = () then return D; - elif ForAny(DigraphVertices(D), i -> i ^ p > DigraphNrVertices(D)) then + fi; + + out := D!.OutNeighbours; + permed := Permuted(out, p); + if Length(permed) > DigraphNrVertices(D) then ErrorNoReturn("the 2nd argument
must be a permutation that permutes ",
"of the digraph