From ce59a70f5b02bb4e3417f5e55e2e77eeeb0c5a9d Mon Sep 17 00:00:00 2001 From: Ihor Antonov Date: Sat, 27 Jul 2019 21:17:57 -0400 Subject: PVS/V560: condition is always true #10624 * before changed line status variable is set to RA_FAIL in 2 places line 3816 and 3826, both lead to short-circuit of the loop, making comparing it to RA_FAIL useless close #10624 --- src/nvim/regexp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 414472a8f3..06b99d0b75 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -4323,8 +4323,10 @@ static int regmatch( /* Still at same position as last time, fail. */ status = RA_NOMATCH; - if (status != RA_FAIL && status != RA_NOMATCH) + assert(status != RA_FAIL); + if (status != RA_NOMATCH) { reg_save(&bp[i].bp_pos, &backpos); + } } break; -- cgit