diff src/screen.c @ 29098:cff23287478f v8.2.5070

patch 8.2.5070: unnecessary code Commit: https://github.com/vim/vim/commit/b5f0801b1f043b5cf99380f58eca51b75b3236c7 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Jun 9 13:55:28 2022 +0100 patch 8.2.5070: unnecessary code Problem: Unnecessary code. Solution: Remove code that isn't needed. (closes https://github.com/vim/vim/issues/10534)
author Bram Moolenaar <Bram@vim.org>
date Thu, 09 Jun 2022 15:00:07 +0200
parents 9b292596a332
children aea330cb546f
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -4904,6 +4904,7 @@ set_chars_option(win_T *wp, char_u **var
 	    {
 		lcs_chars.tab1 = NUL;
 		lcs_chars.tab3 = NUL;
+
 		if (multispace_len > 0)
 		{
 		    lcs_chars.multispace = ALLOC_MULT(int, multispace_len + 1);
@@ -5028,7 +5029,8 @@ set_chars_option(win_T *wp, char_u **var
 		    s = p + len2 + 1;
 		    if (round == 0)
 		    {
-			// Get length of lcsmultispace string in first round
+			// get length of lcs-leadmultispace string in first
+			// round
 			last_lmultispace = p;
 			lead_multispace_len = 0;
 			while (*s != NUL && *s != ',')
@@ -5039,7 +5041,7 @@ set_chars_option(win_T *wp, char_u **var
 			    ++lead_multispace_len;
 			}
 			if (lead_multispace_len == 0)
-			    // lcsmultispace cannot be an empty string
+			    // lcs-leadmultispace cannot be an empty string
 			    return e_invalid_argument;
 			p = s;
 		    }
@@ -5066,10 +5068,8 @@ set_chars_option(win_T *wp, char_u **var
     }
     if (tab == lcstab)
     {
-	if (wp->w_lcs_chars.multispace != NULL)
-	    vim_free(wp->w_lcs_chars.multispace);
-	if (wp->w_lcs_chars.leadmultispace != NULL)
-	    vim_free(wp->w_lcs_chars.leadmultispace);
+	vim_free(wp->w_lcs_chars.multispace);
+	vim_free(wp->w_lcs_chars.leadmultispace);
 	wp->w_lcs_chars = lcs_chars;
     }