mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
refs #937 Resolved clazy warnings: unnecessary detaching of containers.
This commit is contained in:
@@ -163,6 +163,6 @@ const QDBusArgument &operator >>(const QDBusArgument &arg, BlackCore::Context::C
|
||||
{
|
||||
QList<CLogSubscriptionPair> listOfPairs;
|
||||
arg >> listOfPairs;
|
||||
for (const auto &pair : listOfPairs) { hash.insert(pair.first, pair.second); }
|
||||
for (const auto &pair : as_const(listOfPairs)) { hash.insert(pair.first, pair.second); }
|
||||
return arg;
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ namespace BlackCore
|
||||
QSharedPointer<IVoiceChannel> CContextAudio::getVoiceChannelBy(const CVoiceRoom &voiceRoom)
|
||||
{
|
||||
QSharedPointer<IVoiceChannel> voiceChannel;
|
||||
for (const auto &channel : m_voiceChannelMapping.values())
|
||||
for (const auto &channel : as_const(m_voiceChannelMapping))
|
||||
{
|
||||
if (channel->getVoiceRoom().getVoiceRoomUrl() == voiceRoom.getVoiceRoomUrl()) voiceChannel = channel;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include <limits.h>
|
||||
#include <QtGlobal>
|
||||
|
||||
// clazy:excludeall=detaching-member
|
||||
|
||||
using namespace BlackInput;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Input;
|
||||
@@ -107,7 +109,7 @@ namespace BlackCore
|
||||
if (action.isEmpty()) { return; }
|
||||
if (m_actionRelayingEnabled) emit remoteActionFromLocal(action, isKeyDown);
|
||||
|
||||
for (const auto &boundAction : m_boundActions)
|
||||
for (const auto &boundAction : as_const(m_boundActions))
|
||||
{
|
||||
if (boundAction.m_action == action)
|
||||
{
|
||||
|
||||
@@ -97,10 +97,10 @@ namespace BlackCore
|
||||
|
||||
void CWeatherManager::fetchNextWeatherData()
|
||||
{
|
||||
const WeatherRequest weatherRequest = m_pendingRequests.first();
|
||||
const WeatherRequest weatherRequest = m_pendingRequests.constFirst();
|
||||
PhysicalQuantities::CLength maxDistance(100.0, CLengthUnit::km());
|
||||
|
||||
for (IWeatherData *plugin : m_weatherDataPlugins)
|
||||
for (IWeatherData *plugin : as_const(m_weatherDataPlugins))
|
||||
{
|
||||
plugin->fetchWeatherData(weatherRequest.weatherGrid, maxDistance);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ namespace BlackCore
|
||||
Q_ASSERT(weatherDataPlugin);
|
||||
auto fetchedWeatherGrid = weatherDataPlugin->getWeatherData();
|
||||
|
||||
const WeatherRequest weatherRequest = m_pendingRequests.first();
|
||||
const WeatherRequest weatherRequest = m_pendingRequests.constFirst();
|
||||
CWeatherGrid requestedWeatherGrid = weatherRequest.weatherGrid;
|
||||
|
||||
// Interpolation. So far it just picks the closest point without interpolation.
|
||||
|
||||
Reference in New Issue
Block a user