in resolution of [Wsign-compare] warning id 3 #c2

This commit is contained in:
tg-at-google 2020-06-01 16:58:03 -04:00 committed by GitHub
parent 88b2336369
commit e3e3b79cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -365,8 +365,8 @@ bool LogEveryNState::ShouldLog(int n) {
}
bool LogFirstNState::ShouldLog(int n) {
const uint32 counter_value = counter_.load(std::memory_order_relaxed);
if (counter_value < (size_t)n) {
const int counter_value = static_cast<int>( counter_.load(std::memory_order_relaxed) );
if (counter_value < n) {
counter_.store(counter_value + 1, std::memory_order_relaxed);
return true;
}