eval/typval: Add tv_list_equal() tests, compare NULL lists equal

This commit is contained in:
ZyX
2016-10-02 04:34:30 +03:00
parent 4f9e784427
commit b3672ae2fc
3 changed files with 102 additions and 37 deletions

View File

@@ -623,13 +623,12 @@ bool tv_list_equal(list_T *const l1, list_T *const l2, const bool ic,
const bool recursive)
FUNC_ATTR_WARN_UNUSED_RESULT
{
if (l1 == NULL || l2 == NULL) {
// FIXME? compare empty list with NULL list equal
return false;
}
if (l1 == l2) {
return true;
}
if (l1 == NULL || l2 == NULL) {
return false;
}
if (tv_list_len(l1) != tv_list_len(l2)) {
return false;
}