From: Pascal B. <pb...@oi...> - 2000-11-07 08:03:59
|
Not sure about this, but I think the difference between both arrays is that the children[] array contains only the direct childs of a layer/dyndocument and the all[] array contains all layers within that layer/dyndocument (all levels of child objects).. as mentioned, not sure because I don't have the code with me here. Pascal Bestebroer pb...@oi... http://www.oibv.com -----Oorspronkelijk bericht----- Van: dyn...@li... [mailto:dyn...@li...]Namens Robert Rainwater Verzonden: dinsdag 7 november 2000 8:44 Aan: Scott Andrew LePera Onderwerp: Re: [Dynapi-Dev] all vs. allID > After Robert mentioned it, I can think of no good reason for maintaining an > all[] and allID[] array. I don't think there's enough benefit to justify > having both. As he suggested, the dyndocument could just as easily keep a > numeric count as DynLayers are added and removed. > > This would also remove potential memory leaks and speed things up a bit. > Unless someone has other ideas, I would suggest removing the numeric all[] > and replace it with allID, renaming it to all[], of course. While it wouldn't be as easy, I think the same can be done for the .children array. If it were an associative array with the indexes being ids, it would improve the speed of deleteChild and removeChild since they would not have to loop through all of the children. The whole point of those loops is to verify the child exists. Then you could just say if (this.children[id]). Maybe just add a function hasChildren() that returns true/false. As far as naming, .allID should definately be renamed to .all, but of course that would affect the way you access inline layers, so the tutorials would need updating. \\Robert -- _______________________________________________ Dynapi-Dev mailing list Dyn...@li... http://lists.sourceforge.net/mailman/listinfo/dynapi-dev |