changeset 6761:203888fa7192 v7.4.702

patch 7.4.702 Problem: Joining an empty list does uneccessary work. Solution: Let join() return early. (Marco Hinz)
author Bram Moolenaar <bram@vim.org>
date Thu, 16 Apr 2015 22:51:22 +0200
parents d4bb6110de58
children a8cacc29153a
files src/eval.c src/version.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -6780,6 +6780,8 @@ list_join(gap, l, sep, echo_style, copyI
     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);
 
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    702,
+/**/
     701,
 /**/
     700,