From 5189bab1af8d3196f6d74c3a2f24112da9773d03 Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 22 May 2016 15:31:11 +0100 Subject: [PATCH] simplify string operator+= for T --- ostd/string.hh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ostd/string.hh b/ostd/string.hh index 102fe2b..8e50c41 100644 --- a/ostd/string.hh +++ b/ostd/string.hh @@ -528,10 +528,7 @@ public: return append(r); } StringBase &operator+=(T c) { - reserve(p_len + 1); - p_buf.first()[p_len++] = c; - p_buf.first()[p_len] = '\0'; - return *this; + return append(1, c); } template StringBase &operator+=(const R &v) {