cabana: fix shadowed variable in abstractstream.cc (#27976)

pull/28064/head
Willem Melching 2 years ago committed by GitHub
parent 2cf2e784cf
commit 31cdb8de4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      tools/cabana/streams/abstractstream.cc

@ -69,15 +69,15 @@ void AbstractStream::updateLastMsgsTo(double sec) {
last_msgs.clear(); last_msgs.clear();
uint64_t last_ts = (sec + routeStartTime()) * 1e9; uint64_t last_ts = (sec + routeStartTime()) * 1e9;
for (auto &[id, e] : events_) { for (auto &[id, ev] : events_) {
auto it = std::lower_bound(e.crbegin(), e.crend(), last_ts, [](auto e, uint64_t ts) { auto it = std::lower_bound(ev.crbegin(), ev.crend(), last_ts, [](auto e, uint64_t ts) {
return e->mono_time > ts; return e->mono_time > ts;
}); });
if (it != e.crend()) { if (it != ev.crend()) {
double ts = (*it)->mono_time / 1e9 - routeStartTime(); double ts = (*it)->mono_time / 1e9 - routeStartTime();
auto &m = all_msgs[id]; auto &m = all_msgs[id];
m.compute((const char *)(*it)->dat, (*it)->size, ts, getSpeed()); m.compute((const char *)(*it)->dat, (*it)->size, ts, getSpeed());
m.count = std::distance(it, e.crend()); m.count = std::distance(it, ev.crend());
m.freq = m.count / std::max(1.0, ts); m.freq = m.count / std::max(1.0, ts);
} }
} }

Loading…
Cancel
Save