Pass some variables as reference

Spotted by cppcheck.
This commit is contained in:
Jean-Marc Lasgouttes 2019-09-17 23:22:35 +02:00
parent 912704511b
commit 8778e76a98
4 changed files with 6 additions and 6 deletions

View File

@ -520,7 +520,7 @@ vector<docstring> GuiBibtex::getFileEncodings()
} }
void GuiBibtex::setFileEncodings(vector<docstring> const m) void GuiBibtex::setFileEncodings(vector<docstring> const & m)
{ {
for (docstring const & s: m) { for (docstring const & s: m) {
docstring key; docstring key;

View File

@ -88,7 +88,7 @@ private:
/// ///
std::vector<docstring> getFileEncodings(); std::vector<docstring> getFileEncodings();
/// ///
void setFileEncodings(std::vector<docstring> const m); void setFileEncodings(std::vector<docstring> const & m);
/// ///
bool initialiseParams(std::string const & data); bool initialiseParams(std::string const & data);

View File

@ -692,7 +692,7 @@ QStringList GuiCitation::selectedKeys()
} }
void GuiCitation::setPreTexts(vector<docstring> const m) void GuiCitation::setPreTexts(vector<docstring> const & m)
{ {
// account for multiple use of the same keys // account for multiple use of the same keys
QList<QModelIndex> handled; QList<QModelIndex> handled;
@ -731,7 +731,7 @@ vector<docstring> GuiCitation::getPreTexts()
} }
void GuiCitation::setPostTexts(vector<docstring> const m) void GuiCitation::setPostTexts(vector<docstring> const & m)
{ {
// account for multiple use of the same keys // account for multiple use of the same keys
QList<QModelIndex> handled; QList<QModelIndex> handled;

View File

@ -121,11 +121,11 @@ private:
/// Get selected keys /// Get selected keys
QStringList selectedKeys(); QStringList selectedKeys();
/// Set pre texts of qualified lists /// Set pre texts of qualified lists
void setPreTexts(std::vector<docstring> const m); void setPreTexts(std::vector<docstring> const & m);
/// Get pre texts of qualified lists /// Get pre texts of qualified lists
std::vector<docstring> getPreTexts(); std::vector<docstring> getPreTexts();
/// Set post texts of qualified lists /// Set post texts of qualified lists
void setPostTexts(std::vector<docstring> const m); void setPostTexts(std::vector<docstring> const & m);
/// Get post texts of qualified lists /// Get post texts of qualified lists
std::vector<docstring> getPostTexts(); std::vector<docstring> getPostTexts();