Skip to content

Commit

Permalink
More redundant null checks
Browse files Browse the repository at this point in the history
Also remove one unused variable (result)
  • Loading branch information
philstopford committed Apr 1, 2024
1 parent 814034a commit 4ec7c1f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CSharp/Clipper2Lib/Clipper.Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,7 @@ private void DoHorizontal(Active horz)
if (ae.vertexTop == vertex_max)
{
// do this first!!
if (IsHotEdge(horz) && IsJoined(ae!)) Split(ae, ae.top);
if (IsHotEdge(horz) && IsJoined(ae)) Split(ae, ae.top);

if (IsHotEdge(horz))
{
Expand Down Expand Up @@ -2443,7 +2443,7 @@ private static void FixOutRecPts(OutRec outrec)
OutPt op = outrec.pts!;
do
{
op!.outrec = outrec;
op.outrec = outrec;
op = op.next!;
} while (op != outrec.pts);
}
Expand Down Expand Up @@ -2714,7 +2714,7 @@ private void ProcessHorzJoins()
OutRec or2 = GetRealOutRec(j.op2!.outrec)!;

OutPt op1b = j.op1.next!;
OutPt op2b = j.op2.prev!;
OutPt op2b = j.op2.prev;
j.op1.next = j.op2;
j.op2.prev = j.op1;
op1b.prev = op2b;
Expand Down Expand Up @@ -2850,7 +2850,6 @@ private void DoSplitOp(OutRec outrec, OutPt splitOp)
OutPt prevOp = splitOp.prev;
OutPt nextNextOp = splitOp.next!.next!;
outrec.pts = prevOp;
OutPt result = prevOp;

InternalClipper.GetSegmentIntersectPt(
prevOp.pt, splitOp.pt, splitOp.next.pt, nextNextOp.pt, out Point64 ip);
Expand Down Expand Up @@ -3049,7 +3048,7 @@ private bool CheckSplitOwner(OutRec outrec, List<int>? splits)
OutRec? split = GetRealOutRec(_outrecList[i]);
if (split == null || split == outrec || split.recursiveSplit == outrec) continue;
split.recursiveSplit = outrec; //#599
if (split!.splits != null && CheckSplitOwner(outrec, split.splits)) return true;
if (split.splits != null && CheckSplitOwner(outrec, split.splits)) return true;
if (IsValidOwner(outrec, split) &&
CheckBounds(split) &&
split.bounds.Contains(outrec.bounds) &&
Expand Down

0 comments on commit 4ec7c1f

Please sign in to comment.