Commit 27033b59 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2378] Simplify the loadIncremental code

Some of the code can be shared between the variants, saving some code.
parent af1da46e
...@@ -110,26 +110,18 @@ ZoneLoader::loadIncremental(size_t limit) { ...@@ -110,26 +110,18 @@ ZoneLoader::loadIncremental(size_t limit) {
if (iterator_ == ZoneIteratorPtr()) { if (iterator_ == ZoneIteratorPtr()) {
assert(loader_.get() != NULL); assert(loader_.get() != NULL);
if (loader_->loadIncremental(limit)) { complete_ = loader_->loadIncremental(limit);
complete_ = true; if (complete_ && !loaded_ok_) {
if (!loaded_ok_) { isc_throw(MasterFileError, "Error while loading master file");
isc_throw(MasterFileError, "Error while loading master file");
} else {
updater_->commit();
}
return (true);
} else {
return (false);
} }
} else { } else {
if (copyRRsets(updater_, iterator_, limit)) { complete_ = copyRRsets(updater_, iterator_, limit);
updater_->commit(); }
complete_ = true;
return (true); if (complete_) {
} else { updater_->commit();
return (false);
}
} }
return (complete_);
} }
} // end namespace datasrc } // end namespace datasrc
......
Supports Markdown
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