From 84bc2c7ae8f14e909df0ce73463e8e24e1b0e464 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 3 Nov 2011 18:56:47 +0900 Subject: Use std::string::append instead of appending std::string() temporaries. --- src/json.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/json.cc') diff --git a/src/json.cc b/src/json.cc index e686b606..501c9cff 100644 --- a/src/json.cc +++ b/src/json.cc @@ -156,7 +156,7 @@ decodeString break; } if(*first == '\\') { - s += std::string(offset, first); + s.append(offset, first); ++first; checkEof(first, last); if(*first == 'u') { @@ -235,7 +235,7 @@ decodeString } checkEof(first, last); if(std::distance(offset, first) > 0) { - s += std::string(offset, first); + s.append(offset, first); } if(!util::isUtf8(s)) { throw DL_ABORT_EX2("JSON decoding failed: Non UTF-8 string.", -- cgit