]> granicus.if.org Git - vim/commitdiff
patch 9.0.0095: conditions are always true v9.0.0095
authorzeertzjq <zeertzjq@outlook.com>
Wed, 27 Jul 2022 14:48:45 +0000 (15:48 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 27 Jul 2022 14:48:45 +0000 (15:48 +0100)
Problem:    Conditions are always true.
Solution:   Remove useless conditions. (closes #10802)

src/buffer.c
src/cindent.c
src/version.c

index 436c0e95126f6061f754027edc61c32cc10a2a51..108d5967695105101887d52ecb4290effc263846 100644 (file)
@@ -4297,7 +4297,7 @@ build_stl_str_hl(
     curitem = 0;
     prevchar_isflag = TRUE;
     prevchar_isitem = FALSE;
-    for (s = usefmt; *s; )
+    for (s = usefmt; *s != NUL; )
     {
        if (curitem == (int)stl_items_len)
        {
@@ -4327,7 +4327,7 @@ build_stl_str_hl(
            stl_items_len = new_len;
        }
 
-       if (*s != NUL && *s != '%')
+       if (*s != '%')
            prevchar_isflag = prevchar_isitem = FALSE;
 
        /*
index 48ddca5320fbde37a47ce0a000589bdb8367de72..15b459cd6fd4648a843b6105a1279318bfbfd51b 100644 (file)
@@ -2267,7 +2267,8 @@ get_c_indent(void)
                        }
                        // If the start comment string doesn't match with the
                        // start of the comment, skip this entry.  XXX
-                       else if (STRNCMP(ml_get(comment_pos->lnum) + comment_pos->col,
+                       else if (STRNCMP(ml_get(comment_pos->lnum)
+                                                           + comment_pos->col,
                                             lead_start, lead_start_len) != 0)
                            continue;
                    }
@@ -3717,7 +3718,7 @@ term_again:
        // Are we at the start of a cpp base class declaration or
        // constructor initialization?  XXX
        n = FALSE;
-       if (curbuf->b_ind_cpp_baseclass != 0 && theline[0] != '{')
+       if (curbuf->b_ind_cpp_baseclass != 0)
        {
            n = cin_is_cpp_baseclass(&cache_cpp_baseclass);
            l = ml_get_curline();
index 8232111feb3bf5e855d8438560ea32fce951dfe8..064d566ad374c25316033da28e4e33b300033ba0 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    95,
 /**/
     94,
 /**/