summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-03-11 16:18:51 +0000
committerBram Moolenaar <Bram@vim.org>2023-03-11 16:18:51 +0000
commitc481ad38f05c9f759ca7fd01a54c78acad794e85 (patch)
tree4264187f2efa8ccc8b0e31320a5cfa850ad04247 /src/eval.c
parent5145c9a829cd43cb9e7962b181bf99226eb3a53f (diff)
patch 9.0.1401: condition is always truev9.0.1401
Problem: Condition is always true. Solution: Remove the condition. (closes #12139)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/eval.c b/src/eval.c
index c82e7046d0..37b50c38e6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -6885,20 +6885,17 @@ handle_subscript(
*arg = skipwhite(p + 2);
else
*arg = p + 2;
- if (ret == OK)
+ if (VIM_ISWHITE(**arg))
{
- if (VIM_ISWHITE(**arg))
- {
- emsg(_(e_no_white_space_allowed_before_parenthesis));
- ret = FAIL;
- }
- else if ((**arg == '{' && !in_vim9script()) || **arg == '(')
- // expr->{lambda}() or expr->(lambda)()
- ret = eval_lambda(arg, rettv, evalarg, verbose);
- else
- // expr->name()
- ret = eval_method(arg, rettv, evalarg, verbose);
+ emsg(_(e_no_white_space_allowed_before_parenthesis));
+ ret = FAIL;
}
+ else if ((**arg == '{' && !in_vim9script()) || **arg == '(')
+ // expr->{lambda}() or expr->(lambda)()
+ ret = eval_lambda(arg, rettv, evalarg, verbose);
+ else
+ // expr->name()
+ ret = eval_method(arg, rettv, evalarg, verbose);
}
// "." is ".name" lookup when we found a dict or when evaluating and
// scriptversion is at least 2, where string concatenation is "..".