From: Michal 'vorner' Vaner Date: Wed, 12 Jun 2013 09:40:39 +0000 (+0200) Subject: [2726] Reduce variable scope X-Git-Tag: bind10-1.2.0beta1-release~400^2~24 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e4e55d9952dd59962c161d2fc2552176f805244;p=thirdparty%2Fkea.git [2726] Reduce variable scope --- diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc index af3602abbb..c72fdb53df 100644 --- a/src/lib/cc/data.cc +++ b/src/lib/cc/data.cc @@ -688,10 +688,9 @@ NullElement::toJSON(std::ostream& ss) const { void StringElement::toJSON(std::ostream& ss) const { ss << "\""; - char c; const std::string& str = stringValue(); for (size_t i = 0; i < str.size(); ++i) { - c = str[i]; + char c = str[i]; // Escape characters as defined in JSON spec // Note that we do not escape forward slash; this // is allowed, but not mandatory.