Skip to content

Commit

Permalink
Changed comments in response to github remarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
hulpke committed May 1, 2018
1 parent cced6a2 commit c0466aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
13 changes: 9 additions & 4 deletions lib/coll.gi
Original file line number Diff line number Diff line change
Expand Up @@ -3053,16 +3053,21 @@ end);
InstallMethod( CanComputeIsSubset,"default: no, unless identical",
[IsObject,IsObject],IsIdenticalObj);

# avoid immediate methods triggering multiple type changes once the Size of
# an object is known.
# This setter method is installed to implement filter settings in response
# to an objects size as part of setting the size. This used to be handled
# instead by immediate methods, but in a situation as here it would trigger
# multiple immediate methods, several of which could apply and each changing
# the type of the object. Doing so can be costly and thus should be
# avoided.
InstallOtherMethod(SetSize,true,[IsObject and IsAttributeStoringRep,IsObject],
100, # override system setter
function(obj,sz)
local filt;
if HasSize(obj) and Size(obj)<>sz then
if AssertionLevel()>2 then
# Make this an ordinary error to enter break loop so that one can
# investigate call order for debugging
# Make this an ordinary error (not ErrorNoReturn as suggested) to
# preserve all debugging options -- even use `return` to investigate
# what would have happened before this methods was introduced.
Error("size of ",obj," already set to ",Size(obj),
", cannot be changed to ",sz);
fi;
Expand Down
7 changes: 6 additions & 1 deletion lib/csetgrp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,12 @@ local d,fam,typ;
ActingDomain,U,FunctionAction,OnLeftInverse,Representative,g,
CanonicalRepresentativeDeterminatorOfExternalSet,
RightCosetCanonicalRepresentativeDeterminator);
SetSize(d,Size(U)); # as own setter
# We cannot set the size in the previous ObjectifyWithAttributes as there is
# a custom setter method (the one added in this commit). In such a case
# ObjectifyWith Attributes just does `Objectify` and calls all setters
# separately which is what we want to avoid here.
SetSize(d,Size(U));

return d;
end);

Expand Down

0 comments on commit c0466aa

Please sign in to comment.