summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-12 20:48:16 +0100
committerBram Moolenaar <Bram@vim.org>2023-04-12 20:48:16 +0100
commit5299c0933f942c61bfd48064c91365e518fa868c (patch)
tree0f99e21c7b84aa1afd60153aa4c549d6d7324c69
parent01967f5b1042b375b38098eceaf31671902c8dbb (diff)
downloadvim-git-5299c0933f942c61bfd48064c91365e518fa868c.tar.gz
patch 9.0.1446: unnecessary checks for the "skip" flag when skippingv9.0.1446
Problem: Unnecessary checks for the "skip" flag when skipping. Solution: Remove the unnecessary checks. (closes #12254)
-rw-r--r--src/userfunc.c29
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 20 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 3885f67ad..f3ecefc88 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -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);
}
diff --git a/src/version.c b/src/version.c
index e9a53d7bc..f1c3311c3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1446,
+/**/
1445,
/**/
1444,