Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/contractor/contracted_edge_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct ContractedEdgeContainer
edges.insert(edges.end(), new_edges.begin(), new_end);
auto edges_size = edges.size();
auto new_edges_size = std::distance(new_edges.begin(), new_end);
BOOST_ASSERT(static_cast<int>(edges_size) >= new_edges_size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here is a better fix here: We want int64_t which will be equivalent to std::ptrdiff_t (the return type of std::distance). The casting to int was probably there originally because the return type of std::distance is signed.

BOOST_ASSERT(static_cast<int64_t>(edges_size) >= new_edges_size)
flags.resize(edges_size);
std::fill(flags.begin() + edges_size - new_edges_size, flags.end(), flag);

Expand Down
Loading