From b6deb4d1b22bf8c652f40fb4a48f9194efb120b0 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Tue, 26 Apr 2022 14:10:37 +0200 Subject: [PATCH] Addressed second review comments --- src/app/clusters/bindings/PendingNotificationMap.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/clusters/bindings/PendingNotificationMap.h b/src/app/clusters/bindings/PendingNotificationMap.h index fad96ea78cbb74..897749325e1baa 100644 --- a/src/app/clusters/bindings/PendingNotificationMap.h +++ b/src/app/clusters/bindings/PendingNotificationMap.h @@ -38,11 +38,8 @@ class PendingNotificationContext void IncrementConsumersNumber() { mConsumersNumber++; } void DecrementConsumersNumber() { - if (mConsumersNumber > 0) - { - mConsumersNumber--; - } - else + VerifyOrDie(mConsumersNumber > 0); + if (--mConsumersNumber == 0) { // Release the context only if there is no pending notification pointing to it context. if (mPendingNotificationContextReleaseHandler != nullptr)