Task: Reduce temporaries in composeFF4()

- Reducing temporaries leads to 3% performance increase in "import"
  performance test - 6% in "commit", 2% in "other".
This commit is contained in:
Wilhelm Schuermann 2015-11-03 21:13:06 +01:00
parent a2bd6d8342
commit 80b5a584b7

View file

@ -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;
}