In my pallet, I have a StorageDoubleMap
called MyDoubleMap
. I want to delete all the kv pairs under key1
. So I may write the code like below:
for (key2, _value) in MyDoubleMap::<T>::iter_prefix(key1) {
MyDoubleMap::<T>::remove(key1, key2);
}
Apparently the map was changed during the iteration. Will it be problematic?