summaryrefslogtreecommitdiff
path: root/hscript/key.hh
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 07:33:50 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-13 07:33:50 -0500
commitc6b3e345b4e9c6e8797e2b0e1e2b31eca4d62b73 (patch)
tree16db010aa87c0bd37a718038b00fe1e28b7bd061 /hscript/key.hh
parent2eeea474af5a405622c038d93f7a466789114ffe (diff)
downloadhorizon-c6b3e345b4e9c6e8797e2b0e1e2b31eca4d62b73.tar.gz
horizon-c6b3e345b4e9c6e8797e2b0e1e2b31eca4d62b73.tar.bz2
horizon-c6b3e345b4e9c6e8797e2b0e1e2b31eca4d62b73.tar.xz
horizon-c6b3e345b4e9c6e8797e2b0e1e2b31eca4d62b73.zip
hscript: Pass data by reference
Diffstat (limited to 'hscript/key.hh')
-rw-r--r--hscript/key.hh12
1 files changed, 7 insertions, 5 deletions
diff --git a/hscript/key.hh b/hscript/key.hh
index 960095c..f1e2647 100644
--- a/hscript/key.hh
+++ b/hscript/key.hh
@@ -39,8 +39,9 @@ public:
* @returns nullptr if data is unparsable, otherwise a pointer to a Key.
*/
#define UNUSED __attribute__((unused))
- static Key *parseFromData(const std::string data UNUSED, int lineno UNUSED,
- int *errors UNUSED, int *warnings UNUSED) {
+ static Key *parseFromData(const std::string &data UNUSED,
+ int lineno UNUSED, int *errors UNUSED,
+ int *warnings UNUSED) {
return nullptr;
}
#undef UNUSED
@@ -75,8 +76,8 @@ protected:
* @param out Output variable: will contain the value.
* @returns true if value is parsed successfully, false otherwise.
*/
- static bool parse(const std::string what, const std::string where,
- const std::string key, bool *out);
+ static bool parse(const std::string &what, const std::string &where,
+ const std::string &key, bool *out);
public:
/*! Determines if the Key is set or not.
* @returns true if the Key is truthy, false otherwise.
@@ -92,7 +93,8 @@ public:
class StringKey : public Key {
protected:
const std::string _value;
- StringKey(int _line, std::string my_str) : Key(_line), _value(my_str) {}
+ StringKey(int _line, const std::string &my_str) :
+ Key(_line), _value(my_str) {}
public:
/*! Retrieve the value of this key. */