]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1446: unnecessary checks for the "skip" flag when skipping v9.0.1446
authorzeertzjq <zeertzjq@outlook.com>
Wed, 12 Apr 2023 19:48:16 +0000 (20:48 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 12 Apr 2023 19:48:16 +0000 (20:48 +0100)
Problem:    Unnecessary checks for the "skip" flag when skipping.
Solution:   Remove the unnecessary checks. (closes #12254)

src/userfunc.c
src/version.c

index 3885f67ad2c6660fbea753ed8046e5493614924c..f3ecefc88a439769f8bb539f2a9ff8dceb79b95e 100644 (file)
@@ -5868,6 +5868,9 @@ ex_return(exarg_T *eap)
     clear_evalarg(&evalarg, eap);
 }
 
+/*
+ * Lower level implementation of "call".  Only called when not skipping.
+ */
     static int
 ex_call_inner(
        exarg_T     *eap,
@@ -5882,24 +5885,12 @@ ex_call_inner(
     typval_T   rettv;
     int                failed = FALSE;
 
-    /*
-     * When skipping, evaluate the function once, to find the end of the
-     * arguments.
-     * When the function takes a range, this is discovered after the first
-     * call, and the loop is broken.
-     */
-    if (eap->skip)
-    {
-       ++emsg_skip;
-       lnum = eap->line2;      // do it once, also with an invalid range
-    }
-    else
-       lnum = eap->line1;
+    lnum = eap->line1;
     for ( ; lnum <= eap->line2; ++lnum)
     {
        funcexe_T funcexe;
 
-       if (!eap->skip && eap->addr_count > 0)
+       if (eap->addr_count > 0)
        {
            if (lnum > curbuf->b_ml.ml_line_count)
            {
@@ -5927,14 +5918,14 @@ ex_call_inner(
 
        // Handle a function returning a Funcref, Dictionary or List.
        if (handle_subscript(arg, NULL, &rettv,
-                          eap->skip ? NULL : &EVALARG_EVALUATE, TRUE) == FAIL)
+                                             &EVALARG_EVALUATE, TRUE) == FAIL)
        {
            failed = TRUE;
            break;
        }
 
        clear_tv(&rettv);
-       if (doesrange || eap->skip)
+       if (doesrange)
            break;
 
        // Stop when immediately aborting on error, or when an interrupt
@@ -5944,8 +5935,6 @@ ex_call_inner(
        if (aborting())
            break;
     }
-    if (eap->skip)
-       --emsg_skip;
     return failed;
 }
 
@@ -6185,7 +6174,7 @@ ex_call(exarg_T *eap)
        return;
     }
 
-    tofree = trans_function_name_ext(&arg, NULL, eap->skip, TFN_INT,
+    tofree = trans_function_name_ext(&arg, NULL, FALSE, TFN_INT,
                             &fudi, &partial, vim9script ? &type : NULL, NULL);
     if (fudi.fd_newkey != NULL)
     {
@@ -6239,7 +6228,7 @@ ex_call(exarg_T *eap)
        funcexe.fe_firstline = eap->line1;
        funcexe.fe_lastline = eap->line2;
        funcexe.fe_found_var = found_var;
-       funcexe.fe_evaluate = !eap->skip;
+       funcexe.fe_evaluate = TRUE;
        failed = ex_call_inner(eap, name, &arg, startarg, &funcexe, &evalarg);
     }
 
index e9a53d7bc7ef1a3d148164b073f1dc290266c919..f1c3311c3ec26254e74d214da61474bf21151dbb 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1446,
 /**/
     1445,
 /**/