Commit 3372c331 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner

[trac534] Create the origin at zone creation

No need to check every time this added domain isn't origin, we create
one at creation of zone and keep it.
parent 311eb1ae
......@@ -36,7 +36,12 @@ struct MemoryZone::MemoryZoneImpl {
// Constructor
MemoryZoneImpl(const RRClass& zone_class, const Name& origin) :
zone_class_(zone_class), origin_(origin), origin_data_(NULL)
{}
{
// We create the node for origin (it needs to exist anyway in future)
domains_.insert(origin, &origin_data_);
DomainPtr origin_domain(new Domain);
origin_data_->setData(origin_domain);
}
// Some type aliases
/*
......@@ -158,9 +163,6 @@ struct MemoryZone::MemoryZoneImpl {
if (node->isEmpty()) {
domain.reset(new Domain);
node->setData(domain);
if (origin_data_ == NULL && name == origin_) {
origin_data_ = node;
}
} else { // Get existing one
domain = node->getData();
}
......
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