]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0478: channel: redundant str/length assignments in channel_part_info() v9.2.0478
authorJohn Marriott <basilisk@internode.on.net>
Tue, 12 May 2026 17:58:21 +0000 (17:58 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 12 May 2026 17:58:21 +0000 (17:58 +0000)
Problem:  channel: redundant str/length assignments in channel_part_info
Solution: Use the STR_LITERAL_SET() macro (John Marriott)

closes: #20199

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/channel.c
src/version.c

index e703a82089732480ab3dc7426c8a10cfd94cf610..579087b374fed57822dece3ab30ab2205723e625 100644 (file)
@@ -3708,35 +3708,27 @@ channel_part_info(channel_T *channel, dict_T *dict, char *name, ch_part_T part)
 
     STRCPY(namebuf + tail, "io");
     if (part == PART_SOCK)
-    {
-       s.string = (char_u *)"socket";
-       s.length = STRLEN_LITERAL("socket");
-    }
+       STR_LITERAL_SET(s, "socket");
     else switch (chanpart->ch_io)
     {
        case JIO_NULL:
-           s.string = (char_u *)"null";
-           s.length = STRLEN_LITERAL("null");
+           STR_LITERAL_SET(s, "null");
            break;
        case JIO_PIPE:
-           s.string = (char_u *)"pipe";
-           s.length = STRLEN_LITERAL("pipe");
+           STR_LITERAL_SET(s, "pipe");
            break;
        case JIO_FILE:
-           s.string = (char_u *)"file";
-           s.length = STRLEN_LITERAL("file");
+           STR_LITERAL_SET(s, "file");
            break;
        case JIO_BUFFER:
-           s.string = (char_u *)"buffer";
-           s.length = STRLEN_LITERAL("buffer");
+           STR_LITERAL_SET(s, "buffer");
            break;
        case JIO_OUT:
-           s.string = (char_u *)"out";
-           s.length = STRLEN_LITERAL("out");
+           STR_LITERAL_SET(s, "out");
            break;
        default:
-           s.string = (char_u *)"";
-           s.length = 0;
+           STR_LITERAL_SET(s, "");
+           break;
     }
     dict_add_string_len(dict, namebuf, s.string, (int)s.length);
 
index d52a2c468087e4c9e557133d3d904fb22c437465..8f46a438d9499acfd8cf028d3f8a20852eedcd37 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    478,
 /**/
     477,
 /**/