mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:14:37 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user