Skip to content

Commit

Permalink
lib: simplify UnionIfCanEasilySortElements
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Sep 17, 2019
1 parent 3430937 commit 470098f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/grpnames.gi
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,12 @@ InstallMethod( IsTrivialNormalIntersection,
InstallGlobalFunction( UnionIfCanEasilySortElements,

function( arg )
local i, N;

for i in [1..Length(arg)] do
for N in arg[i] do
if not CanEasilySortElements(N) then
return Concatenation(arg);
fi;
od;
od;
return Union(arg);
if ForAll(arg, CanEasilySortElements) then
return Union(arg);
else
return Concatenation(arg);
fi;
end);

#############################################################################
Expand Down

0 comments on commit 470098f

Please sign in to comment.