don't swap iterators when swapping DB contents
Former-commit-id: 4971518d42218a63cf86919e91af54462f6dc8c0
This commit is contained in:
parent
5a23a6da76
commit
bd26d8bad7
@ -186,11 +186,15 @@ int dictMerge(dict *dst, dict *src)
|
||||
if (dictSize(dst) == 0)
|
||||
{
|
||||
std::swap(*dst, *src);
|
||||
std::swap(dst->iterators, src->iterators);
|
||||
return DICT_OK;
|
||||
}
|
||||
|
||||
if (dictSize(src) > dictSize(dst))
|
||||
{
|
||||
std::swap(*dst, *src);
|
||||
std::swap(dst->iterators, src->iterators);
|
||||
}
|
||||
|
||||
if (!dictIsRehashing(dst) && !dictIsRehashing(src))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user