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:
Zbigniew Jędrzejewski-Szmek
2023-11-22 12:32:31 +00:00
committed by Luca Boccassi
parent b2bd488e76
commit fed25720ef
5 changed files with 8 additions and 14 deletions
+2
View File
@@ -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;
}