Browse Source

[2387] Change code to use a reference instead

Mukund Sivaraman 12 years ago
parent
commit
23eca85ebf
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/lib/dns/rdata/generic/nsec3_50.cc

+ 3 - 2
src/lib/dns/rdata/generic/nsec3_50.cc

@@ -137,7 +137,8 @@ NSEC3::constructFromLexer(MasterLexer& lexer) {
     const ParseNSEC3ParamResult params =
         parseNSEC3ParamFromLexer("NSEC3", lexer, salt);
 
-    const string nexthash = lexer.getNextToken(MasterToken::STRING).getString();
+    const string& nexthash =
+        lexer.getNextToken(MasterToken::STRING).getString();
     if (*nexthash.rbegin() == '=') {
         isc_throw(InvalidRdataText, "NSEC3 hash has padding: " << nexthash);
     }
@@ -151,7 +152,7 @@ NSEC3::constructFromLexer(MasterLexer& lexer) {
 
     // For NSEC3 empty bitmap is possible and allowed.
     bool empty_bitmap = false;
-    const MasterToken token = lexer.getNextToken();
+    const MasterToken& token = lexer.getNextToken();
     if ((token.getType() == MasterToken::END_OF_LINE) ||
         (token.getType() == MasterToken::END_OF_FILE)) {
          empty_bitmap = true;