Skip to content

Commit

Permalink
Use explicit std::optional utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo authored Dec 1, 2023
1 parent fad6bd5 commit a33ad67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ double bridgeAngle(
}
}

if (! idx1 || ! idx2)
if (! idx1.hasValue() || ! idx2.hasValue())
return -1.0;

Point2LL center1 = islands[*idx1].centerOfMass();
Point2LL center2 = islands[*idx2].centerOfMass();
Point2LL center1 = islands[idx1.value()].centerOfMass();
Point2LL center2 = islands[idx2.value()].centerOfMass();

return angle(center2 - center1);
}
Expand Down

0 comments on commit a33ad67

Please sign in to comment.