Skip to content

Commit 9d90613

Browse files
committed
Optimizations.
1 parent 919884e commit 9d90613

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/base/threading/asio_event_dispatcher.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ QList<QAbstractEventDispatcher::TimerInfo> AsioEventDispatcher::registeredTimers
188188
//--------------------------------------------------------------------------------------------------
189189
int AsioEventDispatcher::remainingTime(int id)
190190
{
191-
auto it = timers_.find(id);
192-
if (it == timers_.end())
191+
const auto& it = timers_.find(id);
192+
if (it == timers_.cend())
193193
return -1;
194194

195-
uint64_t elapsed = std::chrono::duration_cast<Milliseconds>(
195+
const uint64_t elapsed = std::chrono::duration_cast<Milliseconds>(
196196
Clock::now() - it->second.start_time).count();
197197

198198
return it->second.interval - static_cast<int>(elapsed);

0 commit comments

Comments
 (0)