changeset 32140:7d4705983c7c v9.0.1401

patch 9.0.1401: condition is always true Commit: https://github.com/vim/vim/commit/c481ad38f05c9f759ca7fd01a54c78acad794e85 Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Mar 11 16:18:51 2023 +0000 patch 9.0.1401: condition is always true Problem: Condition is always true. Solution: Remove the condition. (closes https://github.com/vim/vim/issues/12139)
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Mar 2023 17:30:03 +0100
parents 91b362e3a2b7
children fb15a6785644
files src/eval.c src/version.c
diffstat 2 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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 "..".
--- 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 */
 /**/
+    1401,
+/**/
     1400,
 /**/
     1399,