@@ -79,7 +79,7 @@ struct XY
7979template <class PathIterator , class PointArray , class ResultArray >
8080void point_in_path_impl (PointArray &points, PathIterator &path, ResultArray &inside_flag)
8181{
82- bool yflag1;
82+ uint8_t yflag1;
8383 double vtx0, vty0, vtx1, vty1;
8484 double tx, ty;
8585 double sx, sy;
@@ -89,13 +89,13 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
8989
9090 size_t n = points.size ();
9191
92- std::vector<bool > yflag0 (n);
93- std::vector<bool > subpath_flag (n);
92+ std::vector<uint8_t > yflag0 (n);
93+ std::vector<uint8_t > subpath_flag (n);
9494
9595 path.rewind (0 );
9696
9797 for (i = 0 ; i < n; ++i) {
98- inside_flag[i] = false ;
98+ inside_flag[i] = 0 ;
9999 }
100100
101101 unsigned code = 0 ;
@@ -118,7 +118,7 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
118118 // get test bit for above/below X axis
119119 yflag0[i] = (vty0 >= ty);
120120
121- subpath_flag[i] = false ;
121+ subpath_flag[i] = 0 ;
122122 }
123123 }
124124
@@ -164,7 +164,7 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
164164 // Haigh-Hutchinson's different polygon inclusion
165165 // tests.
166166 if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {
167- subpath_flag[i] = subpath_flag[i] ^ true ;
167+ subpath_flag[i] ^= 1 ;
168168 }
169169 }
170170
@@ -196,8 +196,8 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
196196 subpath_flag[i] = subpath_flag[i] ^ true ;
197197 }
198198 }
199- inside_flag[i] = inside_flag[i] || subpath_flag[i];
200- if (inside_flag[i] == false ) {
199+ inside_flag[i] |= subpath_flag[i];
200+ if (inside_flag[i] == 0 ) {
201201 all_done = false ;
202202 }
203203 }
0 commit comments