-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix misc #1143
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1143 +/- ##
==========================================
+ Coverage 91.71% 91.76% +0.04%
==========================================
Files 30 30
Lines 5951 5960 +9
==========================================
+ Hits 5458 5469 +11
+ Misses 493 491 -2 ☔ View full report in Codecov by Sentry. |
@@ -22,7 +23,7 @@ template <typename F, typename Iter> | |||
struct TransformIterator { | |||
private: | |||
Iter iter; | |||
F f; | |||
std::optional<F> f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional so we can use the emplace
function to avoid calling the copy assignment operator of f
, which doesn't exist for lambdas. They only have copy constructors.
@@ -106,8 +106,7 @@ class VecView { | |||
size_t length = std::numeric_limits<size_t>::max()) { | |||
if (length == std::numeric_limits<size_t>::max()) | |||
length = this->size_ - offset; | |||
ASSERT(length >= 0, std::out_of_range("Vec::view out of range")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because length
is unsigned, it cannot be smaller than 0.
@@ -359,8 +359,8 @@ void AppendPartialEdges(Manifold::Impl &outR, Vec<char> &wholeHalfedgeP, | |||
// reference is now to the endVert instead of the startVert, which is one | |||
// position advanced CCW. This is only valid if this is a retained vert; it | |||
// will be ignored later if the vert is new. | |||
const TriRef forwardRef = {forward ? 0 : 1, -1, faceLeftP}; | |||
const TriRef backwardRef = {forward ? 0 : 1, -1, faceRightP}; | |||
const TriRef forwardRef = {forward ? 0 : 1, -1, faceLeftP, -1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The faceID
was never initialized here, so I set it to -1. I think this is fine because we should copy the face IDs later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup!
While debugging #1040 I took the time to fix a bunch of
-Wextra
warnings.