Fix issue with keys order

This commit is contained in:
Vasilii Rogin 2023-05-25 18:10:49 +03:00
parent ecef5910ea
commit 7ef17bfc3d
1 changed files with 3 additions and 3 deletions

View File

@ -383,10 +383,10 @@ public:
throw(std::exception());
};
auto idx = it - keys.begin();
if (idx != keys.size() - 1) {
std::swap(keys[idx], keys[size() - 1]);
keys.resize(keys.size() - 1);
for (size_t i = idx; i < size() - 1; i++) {
std::swap(keys[i], keys[i + 1]);
}
keys.resize(keys.size() - 1);
}
} else {
if (iter == map.end()) {