mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-05 22:09:52 +01:00
Apply several clang-tidy fixes
This commit is contained in:
parent
529470f1d0
commit
dcdb7442a4
@ -86,13 +86,11 @@ void Triangle::MarkNeighbor(Triangle& t)
|
||||
void Triangle::Clear()
|
||||
{
|
||||
Triangle *t;
|
||||
for( int i=0; i<3; i++ )
|
||||
{
|
||||
t = neighbors_[i];
|
||||
if( t != nullptr )
|
||||
{
|
||||
t->ClearNeighbor( this );
|
||||
}
|
||||
for (auto& neighbor : neighbors_) {
|
||||
t = neighbor;
|
||||
if (t != nullptr) {
|
||||
t->ClearNeighbor(this);
|
||||
}
|
||||
}
|
||||
ClearNeighbors();
|
||||
points_[0]=points_[1]=points_[2] = nullptr;
|
||||
@ -410,4 +408,4 @@ bool IsDelaunay(const std::vector<p2t::Triangle*>& triangles)
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace p2t
|
||||
|
@ -107,4 +107,4 @@ AdvancingFront::~AdvancingFront()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace p2t
|
||||
|
@ -815,10 +815,9 @@ void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle&
|
||||
Sweep::~Sweep() {
|
||||
|
||||
// Clean up memory
|
||||
for(size_t i = 0; i < nodes_.size(); i++) {
|
||||
delete nodes_[i];
|
||||
for (auto& node : nodes_) {
|
||||
delete node;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace p2t
|
||||
|
@ -194,17 +194,13 @@ SweepContext::~SweepContext()
|
||||
delete af_middle_;
|
||||
delete af_tail_;
|
||||
|
||||
typedef std::list<Triangle*> type_list;
|
||||
|
||||
for(type_list::iterator iter = map_.begin(); iter != map_.end(); ++iter) {
|
||||
Triangle* ptr = *iter;
|
||||
delete ptr;
|
||||
for (auto ptr : map_) {
|
||||
delete ptr;
|
||||
}
|
||||
|
||||
for(unsigned int i = 0; i < edge_list.size(); i++) {
|
||||
delete edge_list[i];
|
||||
for (auto& i : edge_list) {
|
||||
delete i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace p2t
|
||||
|
Loading…
Reference in New Issue
Block a user