Skip to content

Commit 3946256

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Remove no-longer-needed checks for CHIP_ERROR_KEY_NOT_FOUND. (#15841)
Our storage now guarantees it will return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND when there is nothing stored under the key.
1 parent 2a82c1e commit 3946256

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/transport/GroupPeerMessageCounter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ CHIP_ERROR GroupOutgoingCounters::Init(chip::PersistentStorageDelegate * storage
243243
uint32_t temp;
244244
CHIP_ERROR err;
245245
err = mStorage->SyncGetKeyValue(key.GroupControlCounter(), &temp, size);
246-
if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND || err == CHIP_ERROR_KEY_NOT_FOUND)
246+
if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND)
247247
{
248248
// might be the first time we retrieve the value
249249
// TODO handle this case
@@ -259,7 +259,7 @@ CHIP_ERROR GroupOutgoingCounters::Init(chip::PersistentStorageDelegate * storage
259259
}
260260

261261
err = mStorage->SyncGetKeyValue(key.GroupDataCounter(), &temp, size);
262-
if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND || err == CHIP_ERROR_KEY_NOT_FOUND)
262+
if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND)
263263
{
264264
// might be the first time we retrieve the value
265265
// TODO handle this case

0 commit comments

Comments
 (0)