Commit f54d8505 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac613] use narrower variable scope. also constify variables when possible.

parent 950fc0ab
......@@ -117,11 +117,10 @@ NSEC3::NSEC3(const string& nsec3_str) :
memset(bitmap, 0, sizeof(bitmap));
do {
string type;
int code;
iss >> type;
if (type.length() != 0) {
try {
code = RRType(type).getCode();
const int code = RRType(type).getCode();
bitmap[code / 8] |= (0x80 >> (code % 8));
} catch (...) {
isc_throw(InvalidRdataText, "Invalid RRtype in NSEC3");
......
......@@ -63,10 +63,9 @@ NSEC::NSEC(const string& nsec_str) :
memset(bitmap, 0, sizeof(bitmap));
do {
string type;
int code;
iss >> type;
try {
code = RRType(type).getCode();
const int code = RRType(type).getCode();
bitmap[code / 8] |= (0x80 >> (code % 8));
} catch (...) {
isc_throw(InvalidRdataText, "Invalid RRtype in NSEC");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment