FocusableList.cc,.hh: Pass string arguments by const reference. Found by cppcheck
Ryan Pavlik rpavlik@iastate.edu
2 files changed,
4 insertions(+),
4 deletions(-)
M
src/FocusableList.cc
→
src/FocusableList.cc
@@ -73,7 +73,7 @@ &scr.focusControl().creationOrderList() :
&scr.focusControl().focusedOrderList(); } -FocusableList::FocusableList(BScreen &scr, const string pat): +FocusableList::FocusableList(BScreen &scr, const string & pat): m_pat(0), m_parent(0), m_screen(scr) { int options = 0;@@ -86,7 +86,7 @@ init();
} FocusableList::FocusableList(BScreen &scr, const FocusableList &parent, - const string pat): + const string & pat): m_pat(new ClientPattern(pat.c_str())), m_parent(&parent), m_screen(scr) { init();
M
src/FocusableList.hh
→
src/FocusableList.hh
@@ -49,9 +49,9 @@ STATIC_ORDER = 0x02 ///< use creation order instead of focused order
}; FocusableList(BScreen &scr): m_pat(0), m_parent(0), m_screen(scr) { } - FocusableList(BScreen &scr, const std::string pat); + FocusableList(BScreen &scr, const std::string & pat); FocusableList(BScreen &scr, const FocusableList &parent, - const std::string pat); + const std::string & pat); static void parseArgs(const std::string &in, int &opts, std::string &out); static const FocusableList *getListFromOptions(BScreen &scr, int opts);