On Fri, Mar 16, 2012 at 21:36, Felipe Monteiro de Carvalho <[email protected]> wrote: > Can I add a routine to access the AvgLvlTree as an array? To make it a > better substitute to TFPList in objects which offer an indirect > interface to the internal list, such as TLazAccessibleObject. > > My idea is defining: > Index zero = Tree.FindLowest > Indez Count-1= Tree.FindHighest > > On each access store the last accessed node and if the next call wants > a node index=oldindex+1 or -1 then just use: > > Tree.FindSuccessor(Node) > Tree.FindPrecessor(Node) > > Because almost always I use the array access only to iterate in a loop.
Ouch. This is exactly what enumerators are were designed to avoid. Maybe convert TLazAccessibleObject to expect enumerable instead? -- Alexander S. Klenin -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
