From cb6457dca30847c74cbf738caf83402a391191da Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Sun, 28 Jan 2024 13:30:47 +0000 Subject: [PATCH] Replace instances of "if X then return true; else return false; fi;" by "return X;" --- lib/dict.gi | 6 +----- lib/grp.gi | 15 ++------------- lib/orders.gi | 14 ++------------ lib/ratfun1.gi | 7 +------ 4 files changed, 6 insertions(+), 36 deletions(-) diff --git a/lib/dict.gi b/lib/dict.gi index 654a230fcf..4199dc64ec 100644 --- a/lib/dict.gi +++ b/lib/dict.gi @@ -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, diff --git a/lib/grp.gi b/lib/grp.gi index 1dade57ae2..267e920161 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -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; @@ -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], diff --git a/lib/orders.gi b/lib/orders.gi index 074c25084e..ef72249222 100644 --- a/lib/orders.gi +++ b/lib/orders.gi @@ -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; ######## @@ -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) @@ -1572,5 +1564,3 @@ InstallOtherMethod(WreathProductOrdering, function(f,gensorder,levels) return WreathProductOrdering(ElementsFamily(FamilyObj(f)),gensorder,levels); end); - - diff --git a/lib/ratfun1.gi b/lib/ratfun1.gi index 82d0b8be9c..7264294815 100644 --- a/lib/ratfun1.gi +++ b/lib/ratfun1.gi @@ -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 @@ -1398,4 +1394,3 @@ local c,i,j,m,ex; od; return c; end ); -