From 991bcfe2b210364bb44d051b459b73af1ed30134 Mon Sep 17 00:00:00 2001 From: Clement Date: Thu, 28 Feb 2019 18:00:21 -0800 Subject: [PATCH] Remove dead code --- .../src/audio/AudioMixerSlavePool.cpp | 23 ------------------- .../src/avatars/AvatarMixerSlavePool.cpp | 23 ------------------- 2 files changed, 46 deletions(-) diff --git a/assignment-client/src/audio/AudioMixerSlavePool.cpp b/assignment-client/src/audio/AudioMixerSlavePool.cpp index 7cc7ac9f93..78efb98b37 100644 --- a/assignment-client/src/audio/AudioMixerSlavePool.cpp +++ b/assignment-client/src/audio/AudioMixerSlavePool.cpp @@ -64,10 +64,6 @@ bool AudioMixerSlaveThread::try_pop(SharedNodePointer& node) { return _pool._queue.try_pop(node); } -#ifdef AUDIO_SINGLE_THREADED -static AudioMixerSlave slave; -#endif - void AudioMixerSlavePool::processPackets(ConstIter begin, ConstIter end) { _function = &AudioMixerSlave::processPackets; _configure = [](AudioMixerSlave& slave) {}; @@ -87,19 +83,9 @@ void AudioMixerSlavePool::run(ConstIter begin, ConstIter end) { _begin = begin; _end = end; -#ifdef AUDIO_SINGLE_THREADED - _configure(slave); - std::for_each(begin, end, [&](const SharedNodePointer& node) { - _function(slave, node); - }); -#else // fill the queue std::for_each(_begin, _end, [&](const SharedNodePointer& node) { -#if defined(__clang__) && defined(Q_OS_LINUX) _queue.push(node); -#else - _queue.emplace(node); -#endif }); { @@ -119,17 +105,12 @@ void AudioMixerSlavePool::run(ConstIter begin, ConstIter end) { } assert(_queue.empty()); -#endif } void AudioMixerSlavePool::each(std::function functor) { -#ifdef AUDIO_SINGLE_THREADED - functor(slave); -#else for (auto& slave : _slaves) { functor(*slave.get()); } -#endif } void AudioMixerSlavePool::setNumThreads(int numThreads) { @@ -155,9 +136,6 @@ void AudioMixerSlavePool::setNumThreads(int numThreads) { void AudioMixerSlavePool::resize(int numThreads) { assert(_numThreads == (int)_slaves.size()); -#ifdef AUDIO_SINGLE_THREADED - qDebug("%s: running single threaded", __FUNCTION__, numThreads); -#else qDebug("%s: set %d threads (was %d)", __FUNCTION__, numThreads, _numThreads); Lock lock(_mutex); @@ -205,5 +183,4 @@ void AudioMixerSlavePool::resize(int numThreads) { _numThreads = _numStarted = _numFinished = numThreads; assert(_numThreads == (int)_slaves.size()); -#endif } diff --git a/assignment-client/src/avatars/AvatarMixerSlavePool.cpp b/assignment-client/src/avatars/AvatarMixerSlavePool.cpp index cf842ac792..013d914cbe 100644 --- a/assignment-client/src/avatars/AvatarMixerSlavePool.cpp +++ b/assignment-client/src/avatars/AvatarMixerSlavePool.cpp @@ -63,10 +63,6 @@ bool AvatarMixerSlaveThread::try_pop(SharedNodePointer& node) { return _pool._queue.try_pop(node); } -#ifdef AVATAR_SINGLE_THREADED -static AvatarMixerSlave slave; -#endif - void AvatarMixerSlavePool::processIncomingPackets(ConstIter begin, ConstIter end) { _function = &AvatarMixerSlave::processIncomingPackets; _configure = [=](AvatarMixerSlave& slave) { @@ -89,19 +85,9 @@ void AvatarMixerSlavePool::run(ConstIter begin, ConstIter end) { _begin = begin; _end = end; -#ifdef AUDIO_SINGLE_THREADED - _configure(slave); - std::for_each(begin, end, [&](const SharedNodePointer& node) { - _function(slave, node); -}); -#else // fill the queue std::for_each(_begin, _end, [&](const SharedNodePointer& node) { -#if defined(__clang__) && defined(Q_OS_LINUX) _queue.push(node); -#else - _queue.emplace(node); -#endif }); { @@ -121,18 +107,13 @@ void AvatarMixerSlavePool::run(ConstIter begin, ConstIter end) { } assert(_queue.empty()); -#endif } void AvatarMixerSlavePool::each(std::function functor) { -#ifdef AVATAR_SINGLE_THREADED - functor(slave); -#else for (auto& slave : _slaves) { functor(*slave.get()); } -#endif } void AvatarMixerSlavePool::setNumThreads(int numThreads) { @@ -158,9 +139,6 @@ void AvatarMixerSlavePool::setNumThreads(int numThreads) { void AvatarMixerSlavePool::resize(int numThreads) { assert(_numThreads == (int)_slaves.size()); -#ifdef AVATAR_SINGLE_THREADED - qDebug("%s: running single threaded", __FUNCTION__, numThreads); -#else qDebug("%s: set %d threads (was %d)", __FUNCTION__, numThreads, _numThreads); Lock lock(_mutex); @@ -208,5 +186,4 @@ void AvatarMixerSlavePool::resize(int numThreads) { _numThreads = _numStarted = _numFinished = numThreads; assert(_numThreads == (int)_slaves.size()); -#endif }