File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ bool LeakyBucket::ratelimit(int tokens) {
176
176
if (static_cast < qint64 >(m_currentTokens) < drainTokens) {
177
177
m_currentTokens = 0 ;
178
178
} else {
179
- m_currentTokens -= drainTokens;
179
+ m_currentTokens -= static_cast < decltype (m_currentTokens) >( drainTokens) ;
180
180
}
181
181
182
182
// Now that the tokens have been updated to reflect the constant drain caused by
@@ -187,7 +187,7 @@ bool LeakyBucket::ratelimit(int tokens) {
187
187
188
188
// If the bucket is not overflowed, allow message and add tokens
189
189
if (!limit) {
190
- m_currentTokens += tokens;
190
+ m_currentTokens += static_cast < decltype (m_currentTokens) >( tokens) ;
191
191
}
192
192
193
193
return limit;
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ class LeakyBucket {
85
85
// / (The capacity of the bucket)
86
86
unsigned int m_maxTokens;
87
87
// / The amount of tokens currently stored
88
- // / (The amount of whater currently in the bucket)
88
+ // / (The amount of whatever currently is in the bucket)
89
89
long m_currentTokens;
90
90
// / A timer that is used to measure time intervals. It is essential
91
91
// / that this timer uses a monotonic clock (which is why QElapsedTimer is
You can’t perform that action at this time.
0 commit comments