From 59177db8eff17a32d0c24fe38559eab38e04e23a Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Sun, 23 Oct 2022 20:02:34 +0300 Subject: [PATCH] cleanup: fix code smell knownConditionTrueFalse Inner 'p->stresslevel>=4' will always be true. Thus checking for count_stressed is redundant. --- src/libespeak-ng/intonation.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/libespeak-ng/intonation.c b/src/libespeak-ng/intonation.c index c1664218..65e4f2d4 100644 --- a/src/libespeak-ng/intonation.c +++ b/src/libespeak-ng/intonation.c @@ -790,13 +790,8 @@ static void CalcPitches_Tone(Translator *tr) p = &phoneme_list[0]; for (ix = 0; ix < n_phoneme_list; ix++, p++) { if ((p->type == phVOWEL) && (p->stresslevel >= 4)) { - if (count_stressed == 0) - final_stressed = ix; - - if (p->stresslevel >= 4) { - final_stressed = ix; - count_stressed++; - } + final_stressed = ix; + count_stressed++; } }