From 16baeff5c2a48e32d6c176c912ca608160cb205c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 10 Feb 2025 19:33:14 -0500 Subject: Use std::max() --- include/chilbert/chilbert.ipp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'include/chilbert') diff --git a/include/chilbert/chilbert.ipp b/include/chilbert/chilbert.ipp index bb178bc..8910129 100644 --- a/include/chilbert/chilbert.ipp +++ b/include/chilbert/chilbert.ipp @@ -292,9 +292,7 @@ coords_to_compact_index(const P& p, M = m = 0; for (size_t i = 0; i < n; ++i) { assert(num_bits(p[i]) >= ms[i]); - if (ms[i] > m) { - m = ms[i]; - } + m = std::max(ms[i], m); M += ms[i]; } } @@ -344,9 +342,7 @@ compact_index_to_coords(P& p, if (M == 0 || m == 0) { M = m = 0; for (size_t i = 0; i < n; ++i) { - if (ms[i] > m) { - m = ms[i]; - } + m = std::max(ms[i], m); M += ms[i]; } } -- cgit v1.2.1