Rename ratelimit_test to ratelimit_below

When I see "test", I have to think three times what the return value
means. With "below" this is immediately clear. ratelimit_below(&limit)
sounds almost like English and is imho immediately obvious.

(I also considered ratelimit_ok, but this strongly implies that being under the
limit is somehow better. Most of the times this is true, but then we use the
ratelimit to detect triple-c-a-d, and "ok" doesn't fit so well there.)

C.f. a1bcaa07.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-05-13 22:08:30 +02:00
parent 22dd8d350c
commit 7994ac1d85
14 changed files with 24 additions and 24 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
/* Modelled after Linux' lib/ratelimit.c by Dave Young
* <hidave.darkstar@gmail.com>, which is licensed GPLv2. */
bool ratelimit_test(RateLimit *r) {
bool ratelimit_below(RateLimit *r) {
usec_t ts;
assert(r);
+1 -1
View File
@@ -43,4 +43,4 @@ typedef struct RateLimit {
_r->begin = 0; \
} while (false)
bool ratelimit_test(RateLimit *r);
bool ratelimit_below(RateLimit *r);