[btree_damage_visitor] fluff

This commit is contained in:
Joe Thornber 2013-05-20 13:15:51 +01:00
parent d7c1eabfc0
commit 1ee8afd814

View File

@ -399,11 +399,8 @@ namespace persistent_data {
issue_damage(path_tracker_.current_path(), *mr); issue_damage(path_tracker_.current_path(), *mr);
} }
// FIXME: duplicate code
void end_walk() { void end_walk() {
maybe_range64 mr = dt_.end(); maybe_issue_damage(path_tracker_.current_path());
if (mr)
issue_damage(path_tracker_.current_path(), *mr);
} }
void issue_damage(btree_path const &path, range64 const &r) { void issue_damage(btree_path const &path, range64 const &r) {
@ -426,20 +423,19 @@ namespace persistent_data {
damage_reasons_.clear(); damage_reasons_.clear();
} }
//-------------------------------- void maybe_issue_damage(btree_path const &path) {
maybe_range64 mr = dt_.end();
if (mr)
issue_damage(path, *mr);
}
void update_path(btree_path const &path) { void update_path(btree_path const &path) {
boost::optional<btree_path> old_path = path_tracker_.next_path(path); boost::optional<btree_path> old_path = path_tracker_.next_path(path);
if (old_path) { if (old_path)
// we need to emit any errors that // we need to emit any errors that
// were accrued against the old // were accrued against the old
// path. // path.
maybe_issue_damage(*old_path);
// FIXME: duplicate code with end_walk()
maybe_range64 mr = dt_.end();
if (mr)
issue_damage(*old_path, *mr);
}
} }
//-------------------------------- //--------------------------------