BIND 10 trac2387, updated. ea8936112837ab22263edabe5c44f1f40fa0ef6a [2387] Move string construction out of loop

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Apr 1 09:53:50 UTC 2013


The branch, trac2387 has been updated
       via  ea8936112837ab22263edabe5c44f1f40fa0ef6a (commit)
       via  e42c4c83835acbb17075759f9dd206dcff4a8d37 (commit)
      from  8e3eb1576a4f04736aeb7d44d9b13d19729a7062 (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 ea8936112837ab22263edabe5c44f1f40fa0ef6a
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Apr 1 15:21:15 2013 +0530

    [2387] Move string construction out of loop

commit e42c4c83835acbb17075759f9dd206dcff4a8d37
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Apr 1 15:19:59 2013 +0530

    [2387] Remove unnecessary checks

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

Summary of changes:
 src/lib/dns/rdata/generic/detail/nsec_bitmap.cc |    7 ++-----
 src/lib/dns/rdata/generic/dnskey_48.cc          |    7 ++-----
 2 files changed, 4 insertions(+), 10 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc b/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
index 21556ab..5deaa69 100644
--- a/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
+++ b/src/lib/dns/rdata/generic/detail/nsec_bitmap.cc
@@ -86,6 +86,7 @@ buildBitmapsFromLexer(const char* const rrtype_name,
     memset(bitmap, 0, sizeof(bitmap));
 
     bool have_rrtypes = false;
+    std::string type_str;
     while (true) {
         const MasterToken& token =
             lexer.getNextToken(MasterToken::STRING, true);
@@ -94,13 +95,9 @@ buildBitmapsFromLexer(const char* const rrtype_name,
             break;
         }
 
-        if (token.getType() != MasterToken::STRING) {
-             isc_throw(InvalidRdataText,
-                       "Non-string token found when parsing key data");
-        }
+        // token is now assured to be of type STRING.
 
         have_rrtypes = true;
-        std::string type_str;
         token.getString(type_str);
         try {
             const int code = RRType(type_str).getCode();
diff --git a/src/lib/dns/rdata/generic/dnskey_48.cc b/src/lib/dns/rdata/generic/dnskey_48.cc
index bfe148a..e53f797 100644
--- a/src/lib/dns/rdata/generic/dnskey_48.cc
+++ b/src/lib/dns/rdata/generic/dnskey_48.cc
@@ -161,6 +161,7 @@ DNSKEY::constructFromLexer(MasterLexer& lexer) {
     }
 
     std::string keydata_str;
+    std::string keydata_substr;
     while (true) {
         const MasterToken& token =
             lexer.getNextToken(MasterToken::STRING, true);
@@ -169,12 +170,8 @@ DNSKEY::constructFromLexer(MasterLexer& lexer) {
             break;
         }
 
-        if (token.getType() != MasterToken::STRING) {
-             isc_throw(InvalidRdataText,
-                       "Non-string token found when parsing key data");
-        }
+        // token is now assured to be of type STRING.
 
-        std::string keydata_substr;
         token.getString(keydata_substr);
         keydata_str.append(keydata_substr);
     }



More information about the bind10-changes mailing list