Skip to content

Commit 446dc15

Browse files
committed
Remove redundant erase call
1 parent 44632af commit 446dc15

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

include/boost/graph/transitive_closure.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,11 @@ void transitive_closure(const Graph& g, GraphTC& tc,
107107
}
108108
}
109109
std::sort(adj.begin(), adj.end());
110-
typename std::vector< cg_vertex >::iterator di
110+
const typename std::vector< cg_vertex >::iterator di
111111
= std::unique(adj.begin(), adj.end());
112-
if (di != adj.end())
113-
adj.erase(di, adj.end());
112+
114113
for (typename std::vector< cg_vertex >::const_iterator i = adj.begin();
115-
i != adj.end(); ++i)
114+
i != di; ++i)
116115
{
117116
add_edge(s, *i, CG);
118117
}

0 commit comments

Comments
 (0)