From: Yang Chi Date: Tue, 26 Jul 2016 20:45:01 +0000 (-0700) Subject: No need to go through the list when you just want the size X-Git-Tag: v2016.07.29.00~19 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=bad11d295a2f3ebe66292b6a6b44321ced8aa6ff;p=folly.git 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 --- 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;