mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
Merge branch 'bugfix/nvs_find_performance' into 'master'
fix(nvs): Fixed Page::findItem performance degradation See merge request espressif/esp-idf!29483
This commit is contained in:
commit
68fe7d6e80
@ -882,7 +882,7 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, si
|
||||
// For BLOB_DATA, we may need to search for all chunk indexes, so the hash list won't help
|
||||
// mHashIndex caluclates hash from nsIndex, key, chunkIdx
|
||||
// We may not use mHashList if datatype is BLOB_DATA and chunkIdx is CHUNK_ANY as CHUNK_ANY is used by BLOB_INDEX
|
||||
if (nsIndex != NS_ANY && key != NULL && (datatype == ItemType::BLOB_DATA && chunkIdx != CHUNK_ANY)) {
|
||||
if (nsIndex != NS_ANY && key != NULL && (datatype != ItemType::BLOB_DATA || chunkIdx != CHUNK_ANY)) {
|
||||
size_t cachedIndex = mHashList.find(start, Item(nsIndex, datatype, 0, key, chunkIdx));
|
||||
if (cachedIndex < ENTRY_COUNT) {
|
||||
start = cachedIndex;
|
||||
|
Loading…
x
Reference in New Issue
Block a user