Skip to content

Commit f2a9d8b

Browse files
kkasperczyk-nonordicjm
authored andcommitted
samples: matter: Fixed FinitMap Insert implementation
Insert method returns true in case there is no place to put new object, which is counterintuitive. Signed-off-by: Kamil Kasperczyk <[email protected]>
1 parent f943ec0 commit f2a9d8b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

samples/matter/common/src/util/finite_map.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ template <typename T1, typename T2, uint16_t N> struct FiniteMap {
6262
mMap[slot].key = key;
6363
mMap[slot].value = std::move(value);
6464
mElementsCount++;
65+
} else {
66+
return false;
6567
}
6668
return true;
6769
}

0 commit comments

Comments
 (0)