This is an automated email from the ASF dual-hosted git repository.
serverglen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new d5327f68 fix variable [-Wunused-but-set-variable] warnings (#2243)
d5327f68 is described below
commit d5327f688585f04b0dc8cd011cc2f22d9d541979
Author: LiuQiang <[email protected]>
AuthorDate: Tue May 23 09:48:20 2023 +0800
fix variable [-Wunused-but-set-variable] warnings (#2243)
---
src/brpc/details/hpack.cpp | 3 +--
src/brpc/span.cpp | 2 +-
src/bvar/detail/sampler.cpp | 4 ----
3 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/brpc/details/hpack.cpp b/src/brpc/details/hpack.cpp
index 43a2d9ec..559e9c6c 100644
--- a/src/brpc/details/hpack.cpp
+++ b/src/brpc/details/hpack.cpp
@@ -489,8 +489,7 @@ inline void EncodeInteger(butil::IOBufAppender* out,
uint8_t msb,
value -= max_prefix_value;
msb |= max_prefix_value;
out->push_back(msb);
- size_t out_bytes = 1;
- for (; value >= 128; ++out_bytes) {
+ for (; value >= 128; ) {
const uint8_t c = (value & 0x7f) | 0x80;
value >>= 7;
out->push_back(c);
diff --git a/src/brpc/span.cpp b/src/brpc/span.cpp
index 5c156a14..6e0e64af 100644
--- a/src/brpc/span.cpp
+++ b/src/brpc/span.cpp
@@ -749,7 +749,7 @@ void ListSpans(int64_t starting_realtime, size_t max_scan,
}
BriefSpan brief;
size_t nscan = 0;
- for (size_t i = 0; nscan < max_scan && it->Valid(); ++i, it->Prev()) {
+ for (; nscan < max_scan && it->Valid(); it->Prev()) {
const int64_t key_tm = ToLittleEndian((const
uint32_t*)it->key().data());
// May have some bigger time at the beginning, because leveldb returns
// keys >= starting_realtime.
diff --git a/src/bvar/detail/sampler.cpp b/src/bvar/detail/sampler.cpp
index ea826120..2e231d22 100644
--- a/src/bvar/detail/sampler.cpp
+++ b/src/bvar/detail/sampler.cpp
@@ -160,8 +160,6 @@ void SamplerCollector::run() {
if (s) {
s->InsertBeforeAsList(&root);
}
- int nremoved = 0;
- int nsampled = 0;
for (butil::LinkNode<Sampler>* p = root.next(); p != &root;) {
// We may remove p from the list, save next first.
butil::LinkNode<Sampler>* saved_next = p->next();
@@ -171,11 +169,9 @@ void SamplerCollector::run() {
s->_mutex.unlock();
p->RemoveFromList();
delete s;
- ++nremoved;
} else {
s->take_sample();
s->_mutex.unlock();
- ++nsampled;
}
p = saved_next;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]