Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9729ac2

Browse filesBrowse files
committed
MNT: make local variable const
To make clear we won't be changing them.
1 parent b3476a8 commit 9729ac2
Copy full SHA for 9729ac2

File tree

Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-8
lines changed

‎src/_path.h

Copy file name to clipboardExpand all lines: src/_path.h
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -857,19 +857,19 @@ inline bool segments_intersect(const double &x1,
857857
(fmin(x3, x4) <= fmin(x1, x2) && fmin(x1, x2) <= fmax(x3, x4));
858858
}
859859
}
860-
860+
861861
return false;
862862
}
863863

864-
double n1 = ((x4 - x3) * (y1 - y3)) - ((y4 - y3) * (x1 - x3));
865-
double n2 = ((x2 - x1) * (y1 - y3)) - ((y2 - y1) * (x1 - x3));
864+
const double n1 = ((x4 - x3) * (y1 - y3)) - ((y4 - y3) * (x1 - x3));
865+
const double n2 = ((x2 - x1) * (y1 - y3)) - ((y2 - y1) * (x1 - x3));
866866

867-
double u1 = n1 / den;
868-
double u2 = n2 / den;
867+
const double u1 = n1 / den;
868+
const double u2 = n2 / den;
869869

870-
return ((u1 > 0.0 || isclose(u1, 0.0, rtol, atol)) &&
871-
(u1 < 1.0 || isclose(u1, 1.0, rtol, atol)) &&
872-
(u2 > 0.0 || isclose(u2, 0.0, rtol, atol)) &&
870+
return ((u1 > 0.0 || isclose(u1, 0.0, rtol, atol)) &&
871+
(u1 < 1.0 || isclose(u1, 1.0, rtol, atol)) &&
872+
(u2 > 0.0 || isclose(u2, 0.0, rtol, atol)) &&
873873
(u2 < 1.0 || isclose(u2, 1.0, rtol, atol)));
874874
}
875875

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.