From: Kevin Day Date: Tue, 28 Apr 2020 04:15:56 +0000 (-0500) Subject: Update: only resize if necessary when processing string X-Git-Tag: 0.5.0~319 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=e1d21149b99fbb72b8d815a387a5bcba7502fd14;p=fll Update: only resize if necessary when processing string Avoid unnecessary work. --- diff --git a/level_1/fl_string/c/private-string.c b/level_1/fl_string/c/private-string.c index f46b5b7..99976c3 100644 --- a/level_1/fl_string/c/private-string.c +++ b/level_1/fl_string/c/private-string.c @@ -182,7 +182,7 @@ extern "C" { if (result == 0) { f_macro_string_dynamic_new(status, (*result), size); } - else { + else if (size > result->size) { f_macro_string_dynamic_resize(status, (*result), size); } @@ -207,7 +207,7 @@ extern "C" { if (result == 0) { f_macro_string_dynamic_new(status, (*result), size); } - else { + else if (size > result->size) { f_macro_string_dynamic_resize(status, (*result), size); }