Skip to content

Commit

Permalink
Remove wasteful Milestone calls
Browse files Browse the repository at this point in the history
  • Loading branch information
kpu committed Dec 24, 2012
1 parent 52c514d commit aa77fd1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion util/ersatz_progress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void ErsatzProgress::Milestone() {
next_ = std::numeric_limits<uint64_t>::max();
out_ = NULL;
} else {
next_ = std::max(next_, (stone * complete_) / kWidth);
next_ = std::max(next_, ((stone + 1) * complete_ + kWidth - 1) / kWidth);
}
}

Expand Down
1 change: 0 additions & 1 deletion util/ersatz_progress.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class ErsatzProgress {

void Set(uint64_t to) {
if ((current_ = to) >= next_) Milestone();
Milestone();
}

void Finished() {
Expand Down

0 comments on commit aa77fd1

Please sign in to comment.