Re: [ROOT] Mini-mini optimization in TGButton::SetGroup

From: Valeriy Onuchin (onuchin@sirius.ihep.su)
Date: Thu Nov 08 2001 - 16:35:00 MET


 Hi Thomas,
TGButtonGroup class was being written at the time
when signal-slots appeared in ROOT.

The idea was/is "sending signal" at any time when internal
state of object is changed.
 So, probably, original code was smthng like

void TGButton::SetGroup(TGButtonGroup *group)
{
   if (fGroup != group) {
        fGroup = group;
        Emit("SetGroup(TGButtonGroup*)",group);
   }
}

which was "truncated/simplified" later on.


Regards.    Valeriy



Thomas Bretz wrote:

>
> Hi rooters,
>
> I know that it doesn't really matter, but...
> -----
> void TGButton::SetGroup(TGButtonGroup *group)
> {
>    if (fGroup != group) fGroup = group;
> }
> -----
>
> I don't think that this if statement makes any sense, neither in speed
> nor something else, does it?
>
> Thomas.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:06 MET