scope the age variable to the function
This commit is contained in:
parent
3e77990490
commit
73ee83cd9e
|
@ -268,6 +268,7 @@ void Universe::doDataCallbacks()
|
|||
void Universe::rx_timeout_(bool add_now)
|
||||
{
|
||||
auto now = std::chrono::system_clock::now();
|
||||
auto age = rxAge();
|
||||
if (add_now)
|
||||
{
|
||||
last_seen_ = now;
|
||||
|
@ -275,12 +276,12 @@ void Universe::rx_timeout_(bool add_now)
|
|||
}
|
||||
|
||||
auto elapsed = [] (auto& a, auto& b) {
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(a - b);
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(a - b).count();
|
||||
};
|
||||
|
||||
while (!rx_times_.empty())
|
||||
{
|
||||
auto age = elapsed(now, rx_times_.front()).count();
|
||||
age = elapsed(now, rx_times_.front());
|
||||
if (age < rx_timeout_period_)
|
||||
break;
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue