[vtk-developers] optimisation possible?
Paul Harris
harris.pc at gmail.com
Thu Nov 12 20:55:41 EST 2009
Hi,
in vtkPlanesIntersection.cxx, around line 229, there is this loop:
for (plane=0; plane < nplanes; plane++)
{
where[plane] = this->EvaluateFacePlane(plane, R);
if (allInside && (where[plane] != Inside))
{
allInside = 0;
}
if (where[plane] == Outside)
{
intersects = 0;
break;
}
}
my question is,
why isn't there a break; after allInside=0 ?
and, why are you using the where[] array at all, since it is not referenced
in any other code? (except to alloc and delete)
If you add a break and remove the where array, we can save a tiny bit of
memory, simplify the code a little, and avoid calling EvaluateFacePlane() in
a bunch of situations.
thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091113/8a644396/attachment.html>
More information about the vtk-developers
mailing list