Skip to content

Commit

Permalink
Readability change
Browse files Browse the repository at this point in the history
The long while statement made this confusing to understand. Use braces to make the end of the statement and the action more apparent.
  • Loading branch information
philstopford committed Apr 1, 2024
1 parent 9cefab2 commit 61affb1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CSharp/Clipper2Lib/Clipper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,8 +1054,10 @@ public static Path64 TrimCollinear(Path64 path, bool isOpen = false)
else
{
while (result.Count > 2 && InternalClipper.CrossProduct(
result[result.Count - 1], result[result.Count - 2], result[0]) == 0)
result.RemoveAt(result.Count - 1);
result[result.Count - 1], result[result.Count - 2], result[0]) == 0)
{
result.RemoveAt(result.Count - 1);
}
if (result.Count < 3)
result.Clear();
}
Expand Down

0 comments on commit 61affb1

Please sign in to comment.