mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
FFstrbuf: don't do unneeded destroy work
This commit is contained in:
@@ -31,12 +31,6 @@ void ffStrbufInitCopy(FFstrbuf* strbuf, const FFstrbuf* src)
|
||||
|
||||
static void setCapacity(FFstrbuf* strbuf, uint32_t capacity)
|
||||
{
|
||||
if(capacity == 0)
|
||||
{
|
||||
ffStrbufDestroy(strbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
if(strbuf->allocated == 0)
|
||||
{
|
||||
strbuf->chars = malloc(sizeof(*strbuf->chars) * capacity);
|
||||
@@ -535,6 +529,4 @@ void ffStrbufPutTo(const FFstrbuf* strbuf, FILE* file)
|
||||
void ffStrbufDestroy(FFstrbuf* strbuf)
|
||||
{
|
||||
free(strbuf->chars);
|
||||
strbuf->allocated = 0;
|
||||
ffStrbufClear(strbuf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user