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 <tru3@tru3.com>
This commit is contained in:
h4sht
2026-07-24 02:41:54 +02:00
committed by GitHub
parent c5a8950ad4
commit 97fa52fef0
+1 -3
View File
@@ -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;
}