Skip to content

Commit d6dd562

Browse files
brammooldouglaskayama
authored andcommitted
patch 7.4.702 Problem: Joining an empty list does uneccessary work. Solution: Let join() return early. (Marco Hinz)
1 parent 4c73aa1 commit d6dd562

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/eval.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6781,6 +6781,8 @@ list_join(gap, l, sep, echo_style, copyID)
67816781
join_T *p;
67826782
int i;
67836783

6784+
if (l->lv_len < 1)
6785+
return OK; /* nothing to do */
67846786
ga_init2(&join_ga, (int)sizeof(join_T), l->lv_len);
67856787
retval = list_join_inner(gap, l, sep, echo_style, copyID, &join_ga);
67866788

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ static char *(features[]) =
756756

757757
static int included_patches[] =
758758
{ /* Add new patch number below this line */
759+
/**/
760+
702,
759761
/**/
760762
701,
761763
/**/

0 commit comments

Comments
 (0)