[gmime: 3/24] Reduced unnecessary allocation
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime: 3/24] Reduced unnecessary allocation
- Date: Sat, 26 Aug 2017 13:20:00 +0000 (UTC)
commit 53170eed215901c3de3f4ea71575f0556dba4b21
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Sun Jun 25 21:24:05 2017 -0400
Reduced unnecessary allocation
gmime/gmime-utils.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gmime/gmime-utils.c b/gmime/gmime-utils.c
index bbf1d57..2742e1b 100644
--- a/gmime/gmime-utils.c
+++ b/gmime/gmime-utils.c
@@ -2466,11 +2466,13 @@ header_fold_tokens (GMimeFormatOptions *options, const char *field, const char *
GString *output;
len = strlen (field) + 2;
- output = g_string_sized_new (len + vlen + 1);
+
if (include_field) {
+ output = g_string_sized_new (len + vlen + 1);
g_string_append (output, field);
g_string_append (output, ": ");
} else {
+ output = g_string_sized_new (vlen + 2);
g_string_append_c (output, ' ');
}
lwsp = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]