Minor optimization in TriangleMesh code

This commit is contained in:
Alessandro Ranellucci 2015-01-25 17:30:55 +01:00
parent 9abcd5816c
commit 8a5a0b6726

View file

@ -700,16 +700,16 @@ TriangleMeshSlicer::make_loops(std::vector<IntersectionLine> &lines, Polygons* l
// find a line starting where last one finishes
IntersectionLine* next_line = NULL;
if (loop.back()->edge_b_id != -1) {
IntersectionLinePtrs* candidates = &(by_edge_a_id[loop.back()->edge_b_id]);
for (IntersectionLinePtrs::iterator lineptr = candidates->begin(); lineptr != candidates->end(); ++lineptr) {
IntersectionLinePtrs &candidates = by_edge_a_id[loop.back()->edge_b_id];
for (IntersectionLinePtrs::iterator lineptr = candidates.begin(); lineptr != candidates.end(); ++lineptr) {
if ((*lineptr)->skip) continue;
next_line = *lineptr;
break;
}
}
if (next_line == NULL && loop.back()->b_id != -1) {
IntersectionLinePtrs* candidates = &(by_a_id[loop.back()->b_id]);
for (IntersectionLinePtrs::iterator lineptr = candidates->begin(); lineptr != candidates->end(); ++lineptr) {
IntersectionLinePtrs &candidates = by_a_id[loop.back()->b_id];
for (IntersectionLinePtrs::iterator lineptr = candidates.begin(); lineptr != candidates.end(); ++lineptr) {
if ((*lineptr)->skip) continue;
next_line = *lineptr;
break;