diff options
-rw-r--r-- | include/base.h | 7 | ||||
-rw-r--r-- | src/base.cpp | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/include/base.h b/include/base.h index 5f7ac0ffb..43a3101bd 100644 --- a/include/base.h +++ b/include/base.h @@ -67,7 +67,7 @@ public: * * @return Returns true on success, false if otherwise */ - bool Extend(std::string key, char* p); + bool Extend(const std::string &key, char* p); /** Shrink an Extensible class. * @@ -78,7 +78,7 @@ public: * * @return Returns true on success. */ - bool Shrink(std::string key); + bool Shrink(const std::string &key); /** Get an extension item. * @@ -86,7 +86,7 @@ public: * * @return If you provide a non-existent key name, the function returns NULL, otherwise a pointer to the item referenced by the key is returned. */ - char* GetExt(std::string key); + char* GetExt(const std::string &key); /** Get a list of all extension items names. * @@ -160,4 +160,3 @@ class BoolSet #endif - diff --git a/src/base.cpp b/src/base.cpp index fc6e6583b..53ebda798 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -29,7 +29,7 @@ const int inverted_bitfields[] = {~1,~2,~4,~8,~16,~32,~64,~128}; extern time_t TIME; -bool Extensible::Extend(std::string key, char* p) +bool Extensible::Extend(const std::string &key, char* p) { // only add an item if it doesnt already exist if (this->Extension_Items.find(key) == this->Extension_Items.end()) @@ -42,7 +42,7 @@ bool Extensible::Extend(std::string key, char* p) return false; } -bool Extensible::Shrink(std::string key) +bool Extensible::Shrink(const std::string &key) { // only attempt to remove a map item that exists if (this->Extension_Items.find(key) != this->Extension_Items.end()) @@ -54,7 +54,7 @@ bool Extensible::Shrink(std::string key) return false; } -char* Extensible::GetExt(std::string key) +char* Extensible::GetExt(const std::string &key) { if (this->Extension_Items.find(key) != this->Extension_Items.end()) { |