]> granicus.if.org Git - vim/commitdiff
patch 7.4.702 v7.4.702
authorBram Moolenaar <Bram@vim.org>
Thu, 16 Apr 2015 20:51:22 +0000 (22:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 16 Apr 2015 20:51:22 +0000 (22:51 +0200)
Problem:    Joining an empty list does uneccessary work.
Solution:   Let join() return early. (Marco Hinz)

src/eval.c
src/version.c

index f9df76350c3c0356a8844948e501b1bd7fed087d..b80762e12d7f25f88128c5161ed8e3a64195d0da 100644 (file)
@@ -6780,6 +6780,8 @@ list_join(gap, l, sep, echo_style, copyID)
     join_T     *p;
     int                i;
 
+    if (l->lv_len < 1)
+       return OK; /* nothing to do */
     ga_init2(&join_ga, (int)sizeof(join_T), l->lv_len);
     retval = list_join_inner(gap, l, sep, echo_style, copyID, &join_ga);
 
index 3f913caf994f93c3a80c190142ebbe3e59da6438..0f02ea8ff065af9f239134cee209c8e1159680ac 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    702,
 /**/
     701,
 /**/