tools/analyse: explicit size unique_bytes accumulator
This avoids unsigned overflow.
This commit is contained in:
parent
bdc4a09356
commit
e65958b9aa
@ -236,7 +236,7 @@ int main (int argc, char const **argv)
|
|||||||
auto const unique_bytes = std::accumulate (
|
auto const unique_bytes = std::accumulate (
|
||||||
src.begin (),
|
src.begin (),
|
||||||
src.end (),
|
src.end (),
|
||||||
0, [] (auto const &accum, auto const &rhs) { return accum + rhs.size (); }
|
std::uintmax_t {0}, [] (auto const &accum, auto const &rhs) { return accum + rhs.size (); }
|
||||||
);
|
);
|
||||||
|
|
||||||
auto const duplicated_bytes = total_bytes - unique_bytes;
|
auto const duplicated_bytes = total_bytes - unique_bytes;
|
||||||
|
Loading…
Reference in New Issue
Block a user