Mercurial > vim
changeset 1014:2651e7d07cd6 v7.0.140
updated for version 7.0-140
author | vimboss |
---|---|
date | Tue, 17 Oct 2006 13:16:39 +0000 |
parents | 61e5d40135d0 |
children | 64e2b75e1615 |
files | src/eval.c src/version.c |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -5451,6 +5451,8 @@ list_equal(l1, l2, ic) { listitem_T *item1, *item2; + if (l1 == l2) + return TRUE; if (list_len(l1) != list_len(l2)) return FALSE; @@ -5487,6 +5489,8 @@ dict_equal(d1, d2, ic) dictitem_T *item2; int todo; + if (d1 == d2) + return TRUE; if (dict_len(d1) != dict_len(d2)) return FALSE; @@ -5522,10 +5526,12 @@ tv_equal(tv1, tv2, ic) static int recursive = 0; /* cach recursive loops */ int r; + if (tv1->v_type != tv2->v_type) + return FALSE; /* Catch lists and dicts that have an endless loop by limiting - * recursiveness to 1000. */ - if (tv1->v_type != tv2->v_type || recursive >= 1000) - return FALSE; + * recursiveness to 1000. We guess they are equal then. */ + if (recursive >= 1000) + return TRUE; switch (tv1->v_type) {