mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
crucible: progress: drop the set() method
set() was broken and redundant. Calling hold() and discarding the returned object has the correct effect. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
1beb61fb78
commit
8bc4bee8a3
@ -22,7 +22,6 @@ namespace crucible {
|
||||
ProgressTracker(const value_type &v);
|
||||
value_type begin();
|
||||
value_type end();
|
||||
void set(const value_type &v);
|
||||
|
||||
ProgressHolder hold(const value_type &v);
|
||||
|
||||
@ -66,16 +65,6 @@ namespace crucible {
|
||||
return m_state->m_end;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void
|
||||
ProgressTracker<T>::set(const value_type &v)
|
||||
{
|
||||
unique_lock<mutex> lock(m_state->m_mutex);
|
||||
if (m_state->m_end < v) {
|
||||
m_state->m_end = v;
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
typename ProgressTracker<T>::value_type
|
||||
ProgressTracker<T>::ProgressHolderState::get() const
|
||||
@ -109,7 +98,7 @@ namespace crucible {
|
||||
unique_lock<mutex> lock(m_state->m_mutex);
|
||||
m_state->m_in_progress[make_pair(m_value, this)] = false;
|
||||
auto p = m_state->m_in_progress.begin();
|
||||
while (p!= m_state->m_in_progress.end()) {
|
||||
while (p != m_state->m_in_progress.end()) {
|
||||
if (p->second) {
|
||||
break;
|
||||
}
|
||||
|
@ -1100,7 +1100,7 @@ BeesCrawl::hold_state(const BeesFileRange &bfr)
|
||||
void
|
||||
BeesCrawl::set_state(const BeesCrawlState &bcs)
|
||||
{
|
||||
m_state.set(bcs);
|
||||
m_state.hold(bcs);
|
||||
m_ctx->roots()->crawl_state_set_dirty();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user