From 0fce3ff6bd61a9d5b8d928b624741f31bc176795 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 6 Jan 2008 18:17:25 +0000 Subject: [PATCH] Pass by const reference. Thanks Andre and Peter. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22405 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferParams.cpp | 2 +- src/BufferParams.h | 2 +- src/ModuleList.cpp | 4 ++-- src/ModuleList.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index bc316e24f4..78c4f85494 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1425,7 +1425,7 @@ vector const & BufferParams::getModules() const { -bool BufferParams::addLayoutModule(string modName) { +bool BufferParams::addLayoutModule(string const & modName) { LayoutModuleList::const_iterator it = layoutModules_.begin(); LayoutModuleList::const_iterator end = layoutModules_.end(); for (; it != end; it++) { diff --git a/src/BufferParams.h b/src/BufferParams.h index 5dc05b3c38..36ab933e4c 100644 --- a/src/BufferParams.h +++ b/src/BufferParams.h @@ -133,7 +133,7 @@ public: /// need not be done if we know this isn't the final time through, or if /// the BufferParams do not represent the parameters for an actual buffer /// (as in GuiDocument). - bool addLayoutModule(std::string modName); + bool addLayoutModule(std::string const & modName); /// Clear the list void clearLayoutModules(); diff --git a/src/ModuleList.cpp b/src/ModuleList.cpp index cd282ea70a..d1ff3bee0a 100644 --- a/src/ModuleList.cpp +++ b/src/ModuleList.cpp @@ -34,8 +34,8 @@ namespace lyx { ModuleList moduleList; -LyXModule::LyXModule(string n, string f, string d, - vector p) : +LyXModule::LyXModule(string const & n, string const & f, + string const & d, vector const & p) : name(n), filename(f), description(d), packageList(p), checked(false) {} diff --git a/src/ModuleList.h b/src/ModuleList.h index 2f530e931a..5c22db3036 100644 --- a/src/ModuleList.h +++ b/src/ModuleList.h @@ -28,8 +28,8 @@ namespace lyx { class LyXModule { public: /// - LyXModule(std::string n, std::string f, std::string d, - std::vector p); + LyXModule(std::string const & n, std::string const & f, + std::string const & d, std::vector const & p); /// whether the required packages are available bool isAvailable(); /// what appears in the ui -- 2.39.2