mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Internals: Fix remaining cppcheck errors (#6319)
Fixed the non const-related issue and added suppressions for the const ones. With that `make cppcheck` should be clean.
This commit is contained in:
+6
-6
@@ -428,13 +428,13 @@ struct GraphSortEdgeCmp final {
|
||||
|
||||
void V3Graph::sortVertices() {
|
||||
// Sort list of vertices by rank, then fanout
|
||||
std::vector<V3GraphVertex*> vertices;
|
||||
for (V3GraphVertex& vertex : m_vertices) vertices.push_back(&vertex);
|
||||
std::stable_sort(vertices.begin(), vertices.end(), GraphSortVertexCmp());
|
||||
std::vector<V3GraphVertex*> vertexps;
|
||||
for (V3GraphVertex& vertex : m_vertices) vertexps.push_back(&vertex);
|
||||
std::stable_sort(vertexps.begin(), vertexps.end(), GraphSortVertexCmp());
|
||||
// Re-insert in sorted order
|
||||
for (V3GraphVertex* const ip : vertices) {
|
||||
m_vertices.unlink(ip);
|
||||
m_vertices.linkBack(ip);
|
||||
for (V3GraphVertex* const vertexp : vertexps) {
|
||||
m_vertices.unlink(vertexp);
|
||||
m_vertices.linkBack(vertexp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user