BIND 10 trac2726, updated. 6e4e55d9952dd59962c161d2fc2552176f805244 [2726] Reduce variable scope

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Jun 12 09:40:49 UTC 2013


The branch, trac2726 has been updated
       via  6e4e55d9952dd59962c161d2fc2552176f805244 (commit)
       via  d1bbd4878ba48cd9ebc623b1e8666f425c86e84b (commit)
      from  49305bca03037ecf7cc2f91f75c4fd1c2d8bd5d1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6e4e55d9952dd59962c161d2fc2552176f805244
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date:   Wed Jun 12 11:40:39 2013 +0200

    [2726] Reduce variable scope

commit d1bbd4878ba48cd9ebc623b1e8666f425c86e84b
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date:   Wed Jun 12 11:37:42 2013 +0200

    [2726] Remove useless variable

-----------------------------------------------------------------------

Summary of changes:
 src/lib/asiodns/io_fetch.cc |    3 +--
 src/lib/cc/data.cc          |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/asiodns/io_fetch.cc b/src/lib/asiodns/io_fetch.cc
index eed5fdf..a09d8df 100644
--- a/src/lib/asiodns/io_fetch.cc
+++ b/src/lib/asiodns/io_fetch.cc
@@ -410,10 +410,9 @@ void IOFetch::logIOFailure(asio::error_code ec) {
            (data_->origin == ASIODNS_READ_DATA) ||
            (data_->origin == ASIODNS_UNKNOWN_ORIGIN));
 
-    static const char* PROTOCOL[2] = {"TCP", "UDP"};
     LOG_ERROR(logger, data_->origin).arg(ec.value()).
         arg((data_->remote_snd->getProtocol() == IPPROTO_TCP) ?
-                     PROTOCOL[0] : PROTOCOL[1]).
+                     "TCP" : "UDP").
         arg(data_->remote_snd->getAddress().toText()).
         arg(data_->remote_snd->getPort());
 }
diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc
index af3602a..c72fdb5 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.



More information about the bind10-changes mailing list