This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/develop by this push:
new dbda5b8d Fix code scanning alert no. 5: Unsigned difference expression
compared to zero (#288)
dbda5b8d is described below
commit dbda5b8d12ba3bc22054d4115954590ff9a71e09
Author: Haonan <[email protected]>
AuthorDate: Wed Nov 6 10:14:18 2024 +0800
Fix code scanning alert no. 5: Unsigned difference expression compared to
zero (#288)
Co-authored-by: Copilot Autofix powered by AI
<62310815+github-advanced-security[bot]@users.noreply.github.com>
---
cpp/src/reader/bloom_filter.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpp/src/reader/bloom_filter.cc b/cpp/src/reader/bloom_filter.cc
index 456d1bf8..d2afd664 100644
--- a/cpp/src/reader/bloom_filter.cc
+++ b/cpp/src/reader/bloom_filter.cc
@@ -140,7 +140,7 @@ int BitSet::from_bytes(uint8_t *filter_data, uint32_t
filter_data_bytes_len) {
*(words_ + word_idx) = cur_word;
}
- if (filter_data_bytes_len - word_idx * 8 > 0) {
+ if (filter_data_bytes_len > word_idx * 8) {
uint64_t cur_word = 0;
uint8_t *cur_word_start_byte = filter_data + (word_idx * 8);
for (uint32_t r = 0; r < filter_data_bytes_len - word_idx * 8; r++) {