Skip to content

Commit

Permalink
Replace instances of "if X then return true; else return false; fi;" …
Browse files Browse the repository at this point in the history
…by "return X;"
  • Loading branch information
james-d-mitchell committed Jan 28, 2024
1 parent 9f41719 commit cb6457d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 36 deletions.
6 changes: 1 addition & 5 deletions lib/dict.gi
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,7 @@ InstallMethod(KnowsDictionary,"for lookup sort dictionaries",true,
function(d,x)
local p;
p := PositionSorted(d!.entries,[x]);
if p <= Length(d!.entries) and d!.entries[p][1] = x then
return true;
else
return false;
fi;
return p <= Length(d!.entries) and d!.entries[p][1] = x;
end);

InstallMethod(KnowsDictionary,"for list dictionaries",true,
Expand Down
15 changes: 2 additions & 13 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,7 @@ InstallMethod( IsPowerfulPGroup,
# for p>3 by Jon Gonzalez-Sanchez, Amaia Zugadi-Reizabal
# can be found in 'A characterization of powerful p-groups'
if (p>3) then
if (RankPGroup(G)=Log(Order(Omega(G,p)),p)) then
return true;
else
return false;
fi;
return RankPGroup(G)=Log(Order(Omega(G,p)),p);
else
TryNextMethod();
fi;
Expand Down Expand Up @@ -5735,14 +5731,7 @@ InstallMethod(CharacteristicSubgroups,"use automorphisms",true,[IsGroup],
InstallTrueMethod( CanComputeSize, HasSize );

InstallMethod( CanComputeIndex,"by default impossible unless identical",
IsIdenticalObj, [IsGroup,IsGroup],
function(G,U)
if IsIdenticalObj(G,U) then
return true;
else
return false;
fi;
end);
IsIdenticalObj, [IsGroup,IsGroup], IsIdenticalObj );

InstallMethod( CanComputeIndex,"if sizes can be computed",IsIdenticalObj,
[IsGroup and CanComputeSize,IsGroup and CanComputeSize],
Expand Down
14 changes: 2 additions & 12 deletions lib/orders.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1018,11 +1018,7 @@ function(fam,alphabet)
fi;
od;

if mp<=0 and np<>0 then
return true;
else
return false;
fi;
return mp<=0 and np<>0;
end;

########
Expand Down Expand Up @@ -1074,11 +1070,7 @@ function(fam,alphabet)
fi;
od;

if m =0 and n<>0 then
return true;
else
return false;
fi;
return m =0 and n<>0;
end;

ltfun:=function(u,v)
Expand Down Expand Up @@ -1572,5 +1564,3 @@ InstallOtherMethod(WreathProductOrdering,
function(f,gensorder,levels)
return WreathProductOrdering(ElementsFamily(FamilyObj(f)),gensorder,levels);
end);


7 changes: 1 addition & 6 deletions lib/ratfun1.gi
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,7 @@ local x,y;
x:=x-2;
y:=y-2;
od;
if x<=0 and y>0 then
return true;
else
return false;
fi;
return x<=0 and y>0;
end );

## Low level workhorse for operations with monomials in Zipped form
Expand Down Expand Up @@ -1398,4 +1394,3 @@ local c,i,j,m,ex;
od;
return c;
end );

0 comments on commit cb6457d

Please sign in to comment.