[vtk-developers] optimisation possible?

Karthik Krishnan karthik.krishnan at kitware.com
Thu Nov 12 23:42:10 EST 2009


Please log a bug report and post a patch at vtk.org/Bug

Thanks

On Thu, Nov 12, 2009 at 8:55 PM, Paul Harris <harris.pc at gmail.com> wrote:

> 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
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091112/65c6a5c3/attachment.html>


More information about the vtk-developers mailing list