Fix variable shadowing in BandwidthTracker constructor

This commit is contained in:
Cameron Gutman committed 2026-11-15 00:57:18 -06:00
1 parent bd405f57ca
commit 136610d5fd
1 file changed
+2 -5
+2 -5
View File
@@ -4,12 +4,9 @@ using namespace std::chrono;
BandwidthTracker::BandwidthTracker(uint32_t windowSeconds, uint32_t bucketIntervalMs)
: windowSeconds(seconds(windowSeconds)),
bucketIntervalMs(bucketIntervalMs)
bucketIntervalMs(bucketIntervalMs == 0 ? 250 : bucketIntervalMs)
{
if (bucketIntervalMs <= 0) {
bucketIntervalMs = 250;
}
bucketCount = (windowSeconds * 1000) / bucketIntervalMs;
bucketCount = (windowSeconds * 1000) / this->bucketIntervalMs;
buckets.resize(bucketCount);
}