mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T210, cppcheck fixes
a) 23 performance useInitializationList false Variable 'm_artifactsPilotClient' is assigned in constructor body. Consider performing initialization in initialization list. b) 33 performance passedByValue false Function parameter 'il' should be passed by reference. a) is clear, but b) seems to be wrong, hidden by "cppcheck-suppress"
This commit is contained in:
@@ -18,10 +18,11 @@ namespace BlackMisc
|
||||
namespace Db
|
||||
{
|
||||
CUpdateInfo::CUpdateInfo(const CArtifactList &artifacts, const CDistributionList &distributions) :
|
||||
m_artifactsPilotClient(artifacts.findByType(CArtifact::PilotClientInstaller)),
|
||||
m_artifactsXsb(artifacts.findByType(CArtifact::XSwiftBus)),
|
||||
m_distributions(distributions)
|
||||
{
|
||||
m_artifactsPilotClient = artifacts.findByType(CArtifact::PilotClientInstaller);
|
||||
m_artifactsXsb = artifacts.findByType(CArtifact::XSwiftBus);
|
||||
// void
|
||||
}
|
||||
|
||||
CDistributionList CUpdateInfo::getDistributionsPilotClientForCurrentPlatform() const
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "platformset.h"
|
||||
#include "blackmisc/containerbase.h"
|
||||
#include "blackmisc/dbus.h"
|
||||
@@ -20,8 +22,11 @@ namespace BlackMisc
|
||||
{
|
||||
CPlatformSet::CPlatformSet() { }
|
||||
|
||||
CPlatformSet::CPlatformSet(const CCollection<CPlatform> &other) :
|
||||
CCollection<CPlatform>(other)
|
||||
// cppcheck-suppress passedByValue
|
||||
CPlatformSet::CPlatformSet(std::initializer_list<CPlatform> il) : CCollection<CPlatform>(il)
|
||||
{ }
|
||||
|
||||
CPlatformSet::CPlatformSet(const CCollection<CPlatform> &other) : CCollection<CPlatform>(other)
|
||||
{ }
|
||||
|
||||
QStringList CPlatformSet::getPlatformNames() const
|
||||
@@ -78,3 +83,5 @@ namespace BlackMisc
|
||||
registerMetaValueType<CPlatformSet>();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace BlackMisc
|
||||
CPlatformSet();
|
||||
|
||||
//! Initializer list constructor.
|
||||
CPlatformSet(std::initializer_list<CPlatform> il) : CCollection<CPlatform>(il) {}
|
||||
CPlatformSet(std::initializer_list<CPlatform> il);
|
||||
|
||||
//! Construct from a base class object.
|
||||
CPlatformSet(const CCollection<CPlatform> &other);
|
||||
|
||||
Reference in New Issue
Block a user