diff options
| author | Remko Tronçon <git@el-tramo.be> | 2012-11-12 20:08:59 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2012-11-12 20:18:11 (GMT) |
| commit | dce792fe9583fcb99b5367c089e749aef269d6e9 (patch) | |
| tree | 045b49d93a436cfe7bce888e655c63a07107f939 /Swiften/EventLoop/SingleThreadedEventLoop.cpp | |
| parent | 9b83adf9eb38d10f8cd1108d4c608117a1f8459d (diff) | |
| download | swift-dce792fe9583fcb99b5367c089e749aef269d6e9.zip swift-dce792fe9583fcb99b5367c089e749aef269d6e9.tar.bz2 | |
Use more efficient empty check.
Change-Id: I8690af82a7f73d3883057b2a58a19197d6b09842
Diffstat (limited to 'Swiften/EventLoop/SingleThreadedEventLoop.cpp')
| -rw-r--r-- | Swiften/EventLoop/SingleThreadedEventLoop.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swiften/EventLoop/SingleThreadedEventLoop.cpp b/Swiften/EventLoop/SingleThreadedEventLoop.cpp index 4c5e209..c2235b1 100644 --- a/Swiften/EventLoop/SingleThreadedEventLoop.cpp +++ b/Swiften/EventLoop/SingleThreadedEventLoop.cpp @@ -18,25 +18,25 @@ SingleThreadedEventLoop::SingleThreadedEventLoop() : shouldShutDown_(false) { } SingleThreadedEventLoop::~SingleThreadedEventLoop() { if (!events_.empty()) { std::cerr << "Warning: Pending events in SingleThreadedEventLoop at destruction time." << std::endl; } } void SingleThreadedEventLoop::waitForEvents() { boost::unique_lock<boost::mutex> lock(eventsMutex_); - while (events_.size() == 0 && !shouldShutDown_) { + while (events_.empty() && !shouldShutDown_) { eventsAvailable_.wait(lock); } if (shouldShutDown_) throw EventLoopCanceledException(); } void SingleThreadedEventLoop::handleEvents() { // Make a copy of the list of events so we don't block any threads that post // events while we process them. std::vector<Event> events; { |
Swift