Ah indeed, you are correct.


On Fri, May 30, 2014 at 8:04 PM, Colin Sherratt <notifications@github.com>
wrote:

> In src/cgmath/aabb.rs:
>
> > +
> > +impl<S: BaseNum> Intersect<Option<Point2<S>>> for (Ray2<S>, Aabb2<S>) {
> > +    fn intersection(&self) -> Option<Point2<S>> {
> > +        match *self {
> > +            (ref ray, ref aabb) => {
> > +                let line1 = Line::new(aabb.min,
> > +                                      Point2::new(aabb.max.x, aabb.min.y));
> > +                let line2 = Line::new(Point2::new(aabb.max.x, aabb.min.y),
> > +                                      aabb.max);
> > +                let line3 = Line::new(aabb.max,
> > +                                      Point2::new(aabb.min.x, aabb.max.y));
> > +                let line4 = Line::new(Point2::new(aabb.min.x, aabb.max.y),
> > +                                      aabb.min);
> > +
> > +                // test for intersections with all four sides of the AABB
> > +                let mut hits = Vec::new();
>
> @cmr <https://github.com/cmr> Right. Just trying to point out that the
> there is probably a better way to organize this function. I don't need to
> hold onto any result but the final one, so the pushes could be replaced
> with the test contained in the fold's lambda.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/bjz/cgmath-rs/pull/82/files#r13258967>.
>



-- 
http://octayn.net/