diff --git a/src/components/builder.cpp b/src/components/builder.cpp index 05db9286..36e708d3 100644 --- a/src/components/builder.cpp +++ b/src/components/builder.cpp @@ -55,13 +55,7 @@ string builder::flush() { * Insert raw text string */ void builder::append(string text) { - string str(move(text)); - size_t len{str.length()}; - if (len > 2 && str[0] == '"' && str[len - 1] == '"') { - m_output += str.substr(1, len - 2); - } else { - m_output += str; - } + m_output += text; } /** diff --git a/src/drawtypes/label.cpp b/src/drawtypes/label.cpp index fd74a763..cf7e4c61 100644 --- a/src/drawtypes/label.cpp +++ b/src/drawtypes/label.cpp @@ -135,6 +135,12 @@ namespace drawtypes { text = conf.get(section, name, move(def)); } + size_t len{text.size()}; + + if (len > 2 && text[0] == '"' && text[len - 1] == '"') { + text = text.substr(1, len - 2); + } + const auto get_left_right = [&](string key) { auto value = conf.get(section, key, 0); auto left = conf.get(section, key + "-left", value);