mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +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
|
namespace Db
|
||||||
{
|
{
|
||||||
CUpdateInfo::CUpdateInfo(const CArtifactList &artifacts, const CDistributionList &distributions) :
|
CUpdateInfo::CUpdateInfo(const CArtifactList &artifacts, const CDistributionList &distributions) :
|
||||||
|
m_artifactsPilotClient(artifacts.findByType(CArtifact::PilotClientInstaller)),
|
||||||
|
m_artifactsXsb(artifacts.findByType(CArtifact::XSwiftBus)),
|
||||||
m_distributions(distributions)
|
m_distributions(distributions)
|
||||||
{
|
{
|
||||||
m_artifactsPilotClient = artifacts.findByType(CArtifact::PilotClientInstaller);
|
// void
|
||||||
m_artifactsXsb = artifacts.findByType(CArtifact::XSwiftBus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CDistributionList CUpdateInfo::getDistributionsPilotClientForCurrentPlatform() const
|
CDistributionList CUpdateInfo::getDistributionsPilotClientForCurrentPlatform() const
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//! \cond PRIVATE
|
||||||
|
|
||||||
#include "platformset.h"
|
#include "platformset.h"
|
||||||
#include "blackmisc/containerbase.h"
|
#include "blackmisc/containerbase.h"
|
||||||
#include "blackmisc/dbus.h"
|
#include "blackmisc/dbus.h"
|
||||||
@@ -20,8 +22,11 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
CPlatformSet::CPlatformSet() { }
|
CPlatformSet::CPlatformSet() { }
|
||||||
|
|
||||||
CPlatformSet::CPlatformSet(const CCollection<CPlatform> &other) :
|
// cppcheck-suppress passedByValue
|
||||||
CCollection<CPlatform>(other)
|
CPlatformSet::CPlatformSet(std::initializer_list<CPlatform> il) : CCollection<CPlatform>(il)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
CPlatformSet::CPlatformSet(const CCollection<CPlatform> &other) : CCollection<CPlatform>(other)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
QStringList CPlatformSet::getPlatformNames() const
|
QStringList CPlatformSet::getPlatformNames() const
|
||||||
@@ -78,3 +83,5 @@ namespace BlackMisc
|
|||||||
registerMetaValueType<CPlatformSet>();
|
registerMetaValueType<CPlatformSet>();
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
//! \endcond
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace BlackMisc
|
|||||||
CPlatformSet();
|
CPlatformSet();
|
||||||
|
|
||||||
//! Initializer list constructor.
|
//! Initializer list constructor.
|
||||||
CPlatformSet(std::initializer_list<CPlatform> il) : CCollection<CPlatform>(il) {}
|
CPlatformSet(std::initializer_list<CPlatform> il);
|
||||||
|
|
||||||
//! Construct from a base class object.
|
//! Construct from a base class object.
|
||||||
CPlatformSet(const CCollection<CPlatform> &other);
|
CPlatformSet(const CCollection<CPlatform> &other);
|
||||||
|
|||||||
Reference in New Issue
Block a user