Commit 98783910 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3810] Further changes as a result of the review.

parent 9b8687e3
......@@ -30,11 +30,11 @@ namespace {
/// This function returns the set of supported parameters for
/// host reservation in DHCPv4.
const std::set<std::string>& getSupportedParams4() {
static const char* params[] = {
"duid", "hw-address", "hostname", "ip-address", NULL
};
static std::set<std::string> params_set;
if (params_set.empty()) {
const char* params[] = {
"duid", "hw-address", "hostname", "ip-address", NULL
};
for (int i = 0; params[i] != NULL; ++i) {
params_set.insert(std::string(params[i]));
}
......@@ -47,12 +47,11 @@ const std::set<std::string>& getSupportedParams4() {
/// This function returns the set of supported parameters for
/// host reservation in DHCPv6.
const std::set<std::string>& getSupportedParams6() {
static const char* params[] = {
"duid", "hw-address", "hostname", "ip-addresses", "prefixes", NULL
};
static const size_t params_num = static_cast<const size_t>(sizeof(params) / sizeof(char*));
static std::set<std::string> params_set;
if (params_set.empty()) {
const char* params[] = {
"duid", "hw-address", "hostname", "ip-addresses", "prefixes", NULL
};
for (int i = 0; params[i] != NULL; ++i) {
params_set.insert(std::string(params[i]));
}
......
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