fix(nvs_flash): nvs_set with same key and different data type

Function now always rewrites old value under same key
regardless existing data type. Users requiring old API behaviour
can enable it by kconfig option CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY
This commit is contained in:
radek.tandler
2023-08-25 17:15:18 +02:00
committed by BOT
parent d33ee17dee
commit e8992f500c
9 changed files with 110 additions and 15 deletions
+1 -1
View File
@@ -878,7 +878,7 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, si
end = ENTRY_COUNT;
}
if (nsIndex != NS_ANY && datatype != ItemType::ANY && key != NULL) {
if (nsIndex != NS_ANY && key != NULL) {
size_t cachedIndex = mHashList.find(start, Item(nsIndex, datatype, 0, key, chunkIdx));
if (cachedIndex < ENTRY_COUNT) {
start = cachedIndex;