Skip to contentSkip to conversation

lib/ts_bm.c: remove redundant store to variable consumed after addition

PATCH Applied Colin Ian King 1 participant 1 message Jul 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/ts_bm.c: remove redundant store to variable consumed after addition

There is no need to store the result of the addition back to variable consumed after the addition. The store is redundant, replace += with just +

Cleans up clang scan build warning:
lib/ts_bm.c:83:11: warning: Although the value stored to 'consumed' is used in the enclosing expression, the value is never actually read from 'consumed' [deadcode.DeadStores]

---
 lib/ts_bm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/ts_bm.c +1 -1
index 4cf250031f0f..1f2234221dd1 100644
@@ -80,7 +80,7 @@ static unsigned int bm_find(struct ts_config *conf, struct ts_state *state)
 
 			/* London calling... */
 			DEBUGP("found!\n");
-			return consumed += (shift-(bm->patlen-1));
+			return consumed + (shift-(bm->patlen-1));
 
 next:			bs = bm->bad_shift[text[shift-i]];
 
Signature · 1 line
2.35.3