From 5954c94350b0567e196b786605f68cf3fc0a8b90 Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Sun, 28 Jan 2024 20:17:11 +0000 Subject: [PATCH] Replace instances of "if X then return false; else return true; fi;" by "return not X;" --- lib/grp.gi | 6 +----- lib/kernel.g | 6 +----- lib/ratfun1.gi | 6 +----- lib/straight.gi | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/lib/grp.gi b/lib/grp.gi index 267e920161..c70cb1b2db 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -2955,11 +2955,7 @@ local n,a; fi; a:=AutomorphismGroup(G); - if ForAny(GeneratorsOfGroup(a),i->Image(i,H)<>H) then - return false; - else - return true; - fi; + return not ForAny(GeneratorsOfGroup(a),i->Image(i,H)<>H); end ); diff --git a/lib/kernel.g b/lib/kernel.g index 4a8937fd2e..ec171534d4 100644 --- a/lib/kernel.g +++ b/lib/kernel.g @@ -103,11 +103,7 @@ end; ## ## IS_SUBSTRING := function( str, sub ) - if LEN_LIST(sub) > 0 and POSITION_SUBSTRING(str, sub, 0) = fail then - return false; - else - return true; - fi; + return LEN_LIST(sub) = 0 or POSITION_SUBSTRING(str, sub, 0) <> fail; end; diff --git a/lib/ratfun1.gi b/lib/ratfun1.gi index 7264294815..448f7fcf88 100644 --- a/lib/ratfun1.gi +++ b/lib/ratfun1.gi @@ -635,11 +635,7 @@ local a,b,fam,i, j,ln,ld,rn,rd; od; # is there an a-remainder (then a is larger) # or are both polynomials equal? - if i>0 or i=j then - return false; - else - return true; - fi; + return not (i>0 or i=j); end ); ############################################################################# diff --git a/lib/straight.gi b/lib/straight.gi index efc54e1703..75fc2ad215 100644 --- a/lib/straight.gi +++ b/lib/straight.gi @@ -526,11 +526,7 @@ InstallMethod( IsInternallyConsistent, # If the number of generators is stored then check # that only defined positions are accessed. - if IsBound( nrgens ) and not IsSubset( defined, gens ) then - return false; - else - return true; - fi; + return not ( IsBound( nrgens ) and not IsSubset( defined, gens ) ); end; len:= Length( lines );