From 80b5a584b7149a98f8ca43baac6fad785344804c Mon Sep 17 00:00:00 2001 From: Wilhelm Schuermann Date: Tue, 3 Nov 2015 21:13:06 +0100 Subject: [PATCH] Task: Reduce temporaries in composeFF4() - Reducing temporaries leads to 3% performance increase in "import" performance test - 6% in "commit", 2% in "other". --- src/Task.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Task.cpp b/src/Task.cpp index ee466944f..477712ca2 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -824,11 +824,14 @@ std::string Task::composeF4 () const if (it.second != "") { - ff4 += (first ? "" : " ") - + it.first - + ":\"" - + (type == "string" ? encode (json::encode (it.second)) : it.second) - + "\""; + ff4 += (first ? "" : " "); + ff4 += it.first; + ff4 += ":\""; + if (type == "string") + ff4 += encode (json::encode (it.second)); + else + ff4 += it.second; + ff4 += "\""; first = false; }