From: Stephan Bosch Date: Tue, 9 Nov 2021 22:56:55 +0000 (+0100) Subject: quota: quota-util - Simplify quota_is_over() X-Git-Tag: 2.4.1~146 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a783c51f76bb983dddc962773f656cf84bfd4dd2;p=thirdparty%2Fdovecot%2Fcore.git quota: quota-util - Simplify quota_is_over() --- diff --git a/src/plugins/quota/quota-util.c b/src/plugins/quota/quota-util.c index 3ea95d7b49..0e0738c610 100644 --- a/src/plugins/quota/quota-util.c +++ b/src/plugins/quota/quota-util.c @@ -90,16 +90,12 @@ quota_is_over(uoff_t alloc, int64_t used, uint64_t ceil, uint64_t over) return TRUE; } } - } else if (alloc == 0) { - /* Nothing was allocated in this transaction. We need to - explicitly test this case, since the generic check would fail - if user is already over quota. */ + } else { + /* Resource usage increased in this transaction. */ if (over > 0) { /* Resource usage is already over quota. */ return TRUE; } - } else { - /* Resource usage increased in this transaction. */ if (ceil < alloc || (ceil - alloc) < (uint64_t)used) { /* Limit reached. */ return TRUE;