core: use uniform style for RateLimit initialization
RateLimit is designed so that we can always initialize only the first two fields explicitly. All other call sites use a single line for this.
This commit is contained in:
committed by
Luca Boccassi
parent
b2bd488e76
commit
fed25720ef
@@ -12,6 +12,8 @@ typedef struct RateLimit {
|
||||
usec_t begin;
|
||||
} RateLimit;
|
||||
|
||||
#define RATELIMIT_OFF (const RateLimit) { .interval = USEC_INFINITY, .burst = UINT_MAX }
|
||||
|
||||
static inline void ratelimit_reset(RateLimit *rl) {
|
||||
rl->num = rl->begin = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user