Simplify
This commit is contained in:
parent
8fff3e7bb5
commit
e681b1f064
2 changed files with 14 additions and 18 deletions
|
|
@ -192,21 +192,6 @@ public:
|
|||
update(*state);
|
||||
}
|
||||
|
||||
void setExpected(ActivityId act, ActivityType type, uint64_t expected) override
|
||||
{
|
||||
auto state(state_.lock());
|
||||
|
||||
auto i = state->its.find(act);
|
||||
assert(i != state->its.end());
|
||||
ActInfo & actInfo = *i->second;
|
||||
auto & j = actInfo.expectedByType[type];
|
||||
state->activitiesByType[type].expected -= j;
|
||||
j = expected;
|
||||
state->activitiesByType[type].expected += j;
|
||||
|
||||
update(*state);
|
||||
}
|
||||
|
||||
void result(ActivityId act, ResultType type, const std::vector<Field> & fields) override
|
||||
{
|
||||
auto state(state_.lock());
|
||||
|
|
@ -258,6 +243,18 @@ public:
|
|||
actInfo.failed = getI(fields, 3);
|
||||
update(*state);
|
||||
}
|
||||
|
||||
else if (type == resSetExpected) {
|
||||
auto i = state->its.find(act);
|
||||
assert(i != state->its.end());
|
||||
ActInfo & actInfo = *i->second;
|
||||
auto type = (ActivityType) getI(fields, 0);
|
||||
auto & j = actInfo.expectedByType[type];
|
||||
state->activitiesByType[type].expected -= j;
|
||||
j = getI(fields, 1);
|
||||
state->activitiesByType[type].expected += j;
|
||||
update(*state);
|
||||
}
|
||||
}
|
||||
|
||||
void update()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue