From 97fa52fef0de4b83a601fee0fc312b8e54fca43a Mon Sep 17 00:00:00 2001 From: h4sht Date: Fri, 24 Jul 2026 02:41:54 +0200 Subject: [PATCH] FFstrbuf: removes dead code in ffStrbufSubstrBefore (#2475) The redundant `if (index < strbuf->length)` check inside the static string branch is always true since `strbuf->length <= index` is already checked at the top of the function and returns false. Remove this dead code for clarity. Co-authored-by: tru3 --- src/common/impl/FFstrbuf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/impl/FFstrbuf.c b/src/common/impl/FFstrbuf.c index 35747f8fe..7401a2f22 100644 --- a/src/common/impl/FFstrbuf.c +++ b/src/common/impl/FFstrbuf.c @@ -410,9 +410,7 @@ bool ffStrbufSubstrBefore(FFstrbuf* strbuf, uint32_t index) { if (strbuf->allocated == 0) { // static string - if (index < strbuf->length) { - ffStrbufInitNS(strbuf, index, strbuf->chars); - } + ffStrbufInitNS(strbuf, index, strbuf->chars); return true; }