Skip to content

Commit

Permalink
Simplify a Section method
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Jan 2, 2025
1 parent c68f6ad commit f3687cb
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions gap/autom.gi
Original file line number Diff line number Diff line change
Expand Up @@ -558,15 +558,11 @@ end);
## TODO
InstallMethod(Section, "for [IsAutom, IsList]", [IsAutom, IsList],
function(a, v)
if Length(v) = 0 then
return a;
fi;

if Length(v) = 1 then
return Section(a, v[1]);
fi;

return Section(Section(a, v[1]), v{[2..Length(v)]});
local k;
for k in v do
a := Section(a, k);
od;
return a;

Check warning on line 565 in gap/autom.gi

View check run for this annotation

Codecov / codecov/patch

gap/autom.gi#L562-L565

Added lines #L562 - L565 were not covered by tests
end);


Expand Down

0 comments on commit f3687cb

Please sign in to comment.