Commit 0d94cca2 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1331] Code cleanups

parent 4215daba
......@@ -955,7 +955,7 @@ DatabaseUpdater::addRRset(const RRset& rrset) {
diff_phase_ = ADD;
if (rrset.getType() == RRType::SOA()) {
serial_ =
dynamic_cast<const rdata::generic::SOA&>(it->getCurrent()).
dynamic_cast<const generic::SOA&>(it->getCurrent()).
getSerial();
}
}
......@@ -1004,7 +1004,7 @@ DatabaseUpdater::deleteRRset(const RRset& rrset) {
diff_phase_ = DELETE;
if (rrset.getType() == RRType::SOA()) {
serial_ =
dynamic_cast<const rdata::generic::SOA&>(it->getCurrent()).
dynamic_cast<const generic::SOA&>(it->getCurrent()).
getSerial();
}
}
......@@ -1027,7 +1027,7 @@ DatabaseUpdater::commit() {
<< db_name_);
}
if (journaling_ && diff_phase_ == DELETE) {
isc_throw(isc::Unexpected, "Update sequence not complete");
isc_throw(isc::BatValue, "Update sequence not complete");
}
accessor_->commit();
committed_ = true; // make sure the destructor won't trigger rollback
......
......@@ -301,12 +301,14 @@ struct JournalEntry {
DatabaseAccessor::DiffOperation operation_;
std::string data_[DatabaseAccessor::DIFF_PARAM_COUNT];
bool operator==(const JournalEntry& other) const {
bool data_equal(true);
for (size_t i(0); i < DatabaseAccessor::DIFF_PARAM_COUNT; ++ i) {
data_equal = data_equal && (data_[i] == other.data_[i]);
if (data_[i] != other.data_[i]) {
return false;
}
}
// No need to check data here, checked above
return (id_ == other.id_ && serial_ == other.serial_ &&
operation_ == other.operation_ && data_equal);
operation_ == other.operation_);
}
};
......
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