caProvider: speed up monitor list handling
Not a major speed-up since the list of monitors is per-channel, but using wptr::expired() is more efficient than wptr::lock().
This commit is contained in:
@ -300,10 +300,10 @@ void CAChannel::addMonitor(CAChannelMonitorPtr const & monitor)
|
||||
{
|
||||
std::vector<CAChannelMonitorWPtr>::iterator it;
|
||||
for (it = monitorlist.begin(); it!=monitorlist.end(); ++it) {
|
||||
CAChannelMonitorWPtr mon = *it;
|
||||
if (mon.lock()) continue;
|
||||
mon = monitor;
|
||||
return;
|
||||
if (it->expired()) {
|
||||
*it = monitor;
|
||||
return;
|
||||
}
|
||||
}
|
||||
monitorlist.push_back(monitor);
|
||||
}
|
||||
|
Reference in New Issue
Block a user