Move empty in-flight early exit of simulator tick to before time advancement

This commit is contained in:
Tyler Neely 2022-07-14 13:06:22 +00:00
parent 80970a97f0
commit dc78adde40

View File

@ -226,15 +226,15 @@ class SimulatorHandle {
return false;
}
if (in_flight_.empty()) {
return false;
}
// clock ticks forwards by 400 microseconds on average
std::poisson_distribution<> time_distrib(400);
uint64_t clock_advance = time_distrib(rng_);
cluster_wide_time_microseconds_ += clock_advance;
if (in_flight_.empty()) {
return false;
}
if (config_.scramble_messages) {
// scramble messages
std::uniform_int_distribution<size_t> swap_distrib(0, in_flight_.size() - 1);