[SplashXPathScanner] Remove one unnecessary even-odd check The drawing routine checks if the count is even or odd, but does not care if it is negative or positive, or if the count is large or small - i.e. both adding +1 or -1 has the same effect. Removes one branch and a few other instructions per segment.
diff --git a/splash/SplashXPathScanner.cc b/splash/SplashXPathScanner.cc index ddf5cd8..c2a3e5d 100644 --- a/splash/SplashXPathScanner.cc +++ b/splash/SplashXPathScanner.cc
@@ -245,7 +245,7 @@ y1 = yMax; } int x = splashFloor(seg->x0); - int count = eo || (seg->flags & splashXPathFlipped) ? 1 : -1; + int count = (seg->flags & splashXPathFlipped) ? 1 : -1; for (int y = y0; y <= y1; ++y) { addIntersection(segYMin, segYMax, y, x, x, count); } @@ -265,7 +265,7 @@ if (y1 > yMax) { y1 = yMax; } - int count = eo || (seg->flags & splashXPathFlipped) ? 1 : -1; + int count = (seg->flags & splashXPathFlipped) ? 1 : -1; // Calculate the projected intersection of the segment with the // X-Axis. SplashCoord xbase = seg->x0 - (seg->y0 * seg->dxdy);