From 322e5c5a48836dba6df7e7c83c352e64a0de546d Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Wed, 12 Jan 2022 02:05:12 +0100 Subject: [PATCH] FFstrbuf: don't do unneeded destroy work --- src/util/FFstrbuf.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/util/FFstrbuf.c b/src/util/FFstrbuf.c index bc6e3766f..9b8f7f41c 100644 --- a/src/util/FFstrbuf.c +++ b/src/util/FFstrbuf.c @@ -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); }