]> granicus.if.org Git - vim/commitdiff
patch 8.1.0179: redundant condition for boundary check v8.1.0179
authorBram Moolenaar <Bram@vim.org>
Fri, 13 Jul 2018 14:31:19 +0000 (16:31 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 13 Jul 2018 14:31:19 +0000 (16:31 +0200)
Problem:    Redundant condition for boundary check.
Solution:   Remove the condition. (Dominique Pelle). Change FALSE to FAIL.

src/undo.c
src/version.c

index b3a6276865aefd5f3481d0e79d993fd159cad7b1..040ec548093c69e2a2e052de6f41308aa06e2f1c 100644 (file)
@@ -266,10 +266,8 @@ u_save(linenr_T top, linenr_T bot)
     if (undo_off)
        return OK;
 
-    if (top > curbuf->b_ml.ml_line_count
-           || top >= bot
-           || bot > curbuf->b_ml.ml_line_count + 1)
-       return FALSE;   /* rely on caller to do error messages */
+    if (top >= bot || bot > curbuf->b_ml.ml_line_count + 1)
+       return FAIL;    // rely on caller to give an error message
 
     if (top + 2 == bot)
        u_saveline((linenr_T)(top + 1));
index 1f94b015f319bf6977a2f8904bbd9d3e6aa2a68e..1dae71fcc6f7fe778bd885cacfb5288b9e7e1261 100644 (file)
@@ -789,6 +789,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    179,
 /**/
     178,
 /**/