On Thu, May 27, 2010 at 7:13 PM, Robert Osfield <[email protected]>wrote:

> Hi Tim,
>
> On Thu, May 27, 2010 at 5:02 PM, Tim Moore <[email protected]> wrote:
> > Hi Robert,
> > Here are some cleanup patches for removeExpiredSubgraphs. The main
> feature
> > is removing the need for the localChildrenRemoved vectors. I also
> replaced a
> > couple of loops with STL constructs where I thought it made the code
> > clearer. Finally, changed some of the variables like numToPrune to
> > consistantly be of type size_t.
>
> Jikes, not sure I agree that using STL algorithms here make the code
> cleaner, rather it adds an extra functor into the fix just to use the
> algorithms but in doing so obscures what the code is doing.    Perhaps
> the best thing to have done would have been to have a convenience
> traverse method in CountPagedLODVisitor that traversed the NodeList
> between the specified children.
>
> Well, I find that the for loop initialization and test is noise that
obscures what the code is doing, but I guess that's a matter of taste :) I
hope you will still consider the change to remove localChildrenRemoved.

Changing to type to size_t is not safe as the maths done in the method
> can result in negative values, int's were used for a reason so just
> discarding them is not safe.  None of the containers that the pager
> will be working with will get any where the limits of int so I'm not
> sure what these changes are for.  Is it a warning that you were trying
> to clean up?
>
> I changed them to size_t because that is the proper type to hold the result
of size(). I checked the math and I'm pretty sure that nothing using these
values can go negative. _numPagedLODs must be greater than
_targetMaximumNumberOfLODs, otherwise this code doesn't get run at all.

Tim

> Robert.
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to