cppcheck performance: function parameter should be passed by reference
cppcheck found some minor cases where complex parameters were accidentally passed by value.
This commit is contained in:
parent
b27e560085
commit
e407d71410
|
@ -93,7 +93,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void setURL(const std::string url) { initializeFlags(url); m_url = url; }
|
||||
void setURL(const std::string &url) { initializeFlags(url); m_url = url; }
|
||||
virtual std::string getURL() { return m_url; }
|
||||
|
||||
virtual bool verifySSLHost()
|
||||
|
|
|
@ -78,7 +78,7 @@ void FilteredView::doStart()
|
|||
m_parent->m_removedSignal.connect(ChangeSignal_t::slot_type(boost::bind(&FilteredView::removeIndividual, this, _1, _2)).track(m_self));
|
||||
}
|
||||
|
||||
bool FilteredView::isFull(const Entries_t local2parent,
|
||||
bool FilteredView::isFull(const Entries_t &local2parent,
|
||||
const boost::shared_ptr<IndividualFilter> &filter)
|
||||
{
|
||||
size_t newEndIndex = local2parent.end() - local2parent.begin();
|
||||
|
|
|
@ -49,7 +49,7 @@ class FilteredView : public IndividualView
|
|||
void init(const boost::shared_ptr<FilteredView> &self);
|
||||
|
||||
bool isFull() const { return isFull(m_local2parent, m_filter); }
|
||||
static bool isFull(const Entries_t local2parent,
|
||||
static bool isFull(const Entries_t &local2parent,
|
||||
const boost::shared_ptr<IndividualFilter> &filter);
|
||||
|
||||
/**
|
||||
|
|
|
@ -386,7 +386,7 @@ public:
|
|||
* the sync starts and overwriting it when the connection
|
||||
* closes.
|
||||
*/
|
||||
void setStubConnectionError(const std::string error) { m_connectionError = error; }
|
||||
void setStubConnectionError(const std::string &error) { m_connectionError = error; }
|
||||
std::string getStubConnectionError() { return m_connectionError; }
|
||||
|
||||
Server &getServer() { return m_server; }
|
||||
|
|
|
@ -110,7 +110,7 @@ bool Cmdline::parse()
|
|||
/**
|
||||
* Detects "--sync foo", "--sync=foo", "-s foo".
|
||||
*/
|
||||
static bool IsKeyword(const std::string arg,
|
||||
static bool IsKeyword(const std::string &arg,
|
||||
const char *longWord,
|
||||
const char *shortWord)
|
||||
{
|
||||
|
|
|
@ -1106,7 +1106,7 @@ private:
|
|||
string m_previousLogdir; /**< remember previous log dir before creating the new one */
|
||||
|
||||
/** create name in current (if set) or previous logdir */
|
||||
string databaseName(SyncSource &source, const string suffix, string logdir = "") {
|
||||
string databaseName(SyncSource &source, const string &suffix, string logdir = "") {
|
||||
if (!logdir.size()) {
|
||||
logdir = m_logdir->getLogdir();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue