From bad11d295a2f3ebe66292b6a6b44321ced8aa6ff Mon Sep 17 00:00:00 2001 From: Yang Chi Date: Tue, 26 Jul 2016 13:45:01 -0700 Subject: [PATCH] No need to go through the list when you just want the size Summary: cb is an unused variable, and i got error in android. It seems like we don't need to go through the list to increase count. Differential Revision: D3622772 fbshipit-source-id: fe1f81a1fcad5bacad052e14b7b0b370beb3f3e5 --- folly/io/async/HHWheelTimer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/folly/io/async/HHWheelTimer.cpp b/folly/io/async/HHWheelTimer.cpp index 55d489b5..9918f9dd 100644 --- a/folly/io/async/HHWheelTimer.cpp +++ b/folly/io/async/HHWheelTimer.cpp @@ -237,9 +237,7 @@ size_t HHWheelTimer::cancelAll() { if (bucket.empty()) { continue; } - for (auto& cb : bucket) { - count++; - } + count += bucket.size(); std::swap(bucket, buckets[countBuckets++]); if (count >= count_) { break; -- 2.34.1