mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
vim-patch:8.2.0619: null dict is not handled like an empty dict
Problem: Null dict is not handled like an empty dict.
Solution: Fix the code and add tests. (Yegappan Lakshmanan, closes vim/vim#5968)
ea04a6e8ba
Nvim doesn't support modifying NULL list, so comment out a line.
This commit is contained in:
@@ -2490,10 +2490,14 @@ bool tv_dict_equal(dict_T *const d1, dict_T *const d2, const bool ic, const bool
|
||||
if (d1 == d2) {
|
||||
return true;
|
||||
}
|
||||
if (d1 == NULL || d2 == NULL) {
|
||||
if (tv_dict_len(d1) != tv_dict_len(d2)) {
|
||||
return false;
|
||||
}
|
||||
if (tv_dict_len(d1) != tv_dict_len(d2)) {
|
||||
if (tv_dict_len(d1) == 0) {
|
||||
// empty and NULL dicts are considered equal
|
||||
return true;
|
||||
}
|
||||
if (d1 == NULL || d2 == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user