pip-performance merge bug

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pip-performance merge bug

Sandro Santilli-4
On Tue, Jun 11, 2019 at 04:52:28PM -0700, [hidden email] wrote:

[...]

> commit f378ac5348002ce611a360eaf59a8bb281ecfa7b
> Author: Daniel Baston <[hidden email]>
> Date:   Mon Jun 10 15:09:56 2019 -0400
>
>     Avoid relying on numeric ordering of Location
>

[...]

>  
> -        max_loc = std::max(max_loc, loc);
> -        if (max_loc == geom::Location::EXTERIOR) {
> -            found = true;
> +        if (outermost_loc == Location::UNDEF || outermost_loc == Location::INTERIOR) {
> +            outermost_loc = loc;
> +        } else if (Location::EXTERIOR) {
> +            outermost_loc = loc;
> +            done = true;
>          }
>      }

The final "else if" condition will always be true (or false, depending
on the value of Location::EXTERIOR constant). I'm concerned that no
test failed with that bug in place, so if there's anything you can do
to trigger such bug it'd be great to add a test for it.

NOTE: my compiler (gcc 7.3.0) did catch it:

  .../src/geom/prep/PreparedPolygonPredicate.cpp:101:38: warning: enum constant in boolean context [-Wint-in-bool-context]
          } else if (Location::EXTERIOR) {
                     ^

--strk;

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel