You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2023/01/24 09:25:21 UTC
[datasketches-cpp] 02/02: Remove unsigned < 0 check
This is an automated email from the ASF dual-hosted git repository.
jmalkin pushed a commit to branch 4.0-cleanup
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git
commit f042608f4a9ce1b500b69330392e07b995cbc4ad
Author: Jon Malkin <78...@users.noreply.github.com>
AuthorDate: Wed Jan 11 18:13:51 2023 -0800
Remove unsigned < 0 check
uint8_t can never be < 0 so this addresses a warning from gcc.
---
cpc/include/cpc_compressor_impl.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpc/include/cpc_compressor_impl.hpp b/cpc/include/cpc_compressor_impl.hpp
index ef0ce61..7f323be 100644
--- a/cpc/include/cpc_compressor_impl.hpp
+++ b/cpc/include/cpc_compressor_impl.hpp
@@ -449,7 +449,7 @@ uint8_t cpc_compressor<A>::determine_pseudo_phase(uint8_t lg_k, uint32_t c) {
if (lg_k < 4) throw std::logic_error("lgK < 4");
const size_t tmp = c >> (lg_k - 4);
const uint8_t phase = tmp & 15;
- if (phase < 0 || phase >= 16) throw std::out_of_range("wrong phase");
+ if (phase >= 16) throw std::out_of_range("wrong phase");
return phase;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org