[fpc-devel] Duplicate code inTDatasource.DistributeEvent implementation

Jesus Reyes jesusrmx at yahoo.com.mx
Mon May 9 07:57:46 CEST 2005


----- Original Message ----- 
From: "Luiz Américo" <pascalive at bol.com.br>
To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
Sent: Sunday, May 08, 2005 6:45 PM
Subject: Re: [fpc-devel] Duplicate code inTDatasource.DistributeEvent implementation


> Michael Van Canneyt wrote:
> > 
> > On Sat, 7 May 2005, Luiz Américo wrote:
> > 
> > 
> > No. First non visual components (such as detail datasets, lookup datasets) 
> > must get their event, and only then visual controls get an event. 
> > 
> > The double loop is intentional.
> > 
> 
> Thank you.
> Now I can see the intention.
> 
> It seens that this procedure is called quite often.
> One approach to optimize could be inserting the items in FDataLinks in 
> the appropriate order (Non visual first, visual in the end) and doing a 
> simple loop without checks in DistributeEvent.
> This would be done inside RegisterDataLink with a simple and safe alghoritm.
> 
> If you agree with the cited approach i can send the patch.
> 
> Luiz
> 

I doubt that you will get any improvement. Probably what target components do inside the event handling is potentially more slower (if speed is in this case the concern) than iterating through the list of datalinks.

Jesus Reyes A.


More information about the fpc-devel mailing list