aboutsummaryrefslogtreecommitdiff
path: root/lib/univalue.cpp
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2016-09-30 19:58:11 +0200
committerMarcoFalke <[email protected]>2016-09-30 19:58:11 +0200
commit2ca7faab4205822b06dc2ab2bbda0a9a70fce7e0 (patch)
treefe714bb1bdfbd52842107b54c590cfe5d4c58b3c /lib/univalue.cpp
parentSquashed 'src/univalue/' changes from f32df99..daf1285 (diff)
downloaddiscoin-2ca7faab4205822b06dc2ab2bbda0a9a70fce7e0.tar.xz
discoin-2ca7faab4205822b06dc2ab2bbda0a9a70fce7e0.zip
Squashed 'src/univalue/' changes from daf1285..16a1f7f
16a1f7f Merge #3: Pull upstream 3f03bfd Merge pull request #27 from laanwj/2016_09_const_refs 5668ca3 Return const references from getKeys, getValues, get_str cedda14 Merge pull request #28 from MarcoFalke/patch-1 9f0b997 [travis] Work around osx libtool issue git-subtree-dir: src/univalue git-subtree-split: 16a1f7f6e9ed932bec7c7855003affea1e165fb5
Diffstat (limited to 'lib/univalue.cpp')
-rw-r--r--lib/univalue.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/univalue.cpp b/lib/univalue.cpp
index 1f8cee6d2..5a2860c13 100644
--- a/lib/univalue.cpp
+++ b/lib/univalue.cpp
@@ -283,14 +283,14 @@ const UniValue& find_value(const UniValue& obj, const std::string& name)
return NullUniValue;
}
-std::vector<std::string> UniValue::getKeys() const
+const std::vector<std::string>& UniValue::getKeys() const
{
if (typ != VOBJ)
throw std::runtime_error("JSON value is not an object as expected");
return keys;
}
-std::vector<UniValue> UniValue::getValues() const
+const std::vector<UniValue>& UniValue::getValues() const
{
if (typ != VOBJ && typ != VARR)
throw std::runtime_error("JSON value is not an object or array as expected");
@@ -304,7 +304,7 @@ bool UniValue::get_bool() const
return getBool();
}
-std::string UniValue::get_str() const
+const std::string& UniValue::get_str() const
{
if (typ != VSTR)
throw std::runtime_error("JSON value is not a string as expected");