mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Round one of fixes to avoid ridiculous numbers of spurious copy constructor and destructor calls.
Most of these fixes involve calls to BOOST_FOREACH to iterate over a map or unordered_map where the iterator type didn't perfectly match the internal type, so a reference into the map couldn't be created and a new value/content pair had to be created for each iteration.
This commit is contained in:
@@ -81,8 +81,8 @@ bool ParameterNode::addNode(const std::string& name, Parameter::ref node)
|
||||
Json::Value ParameterNode::getValue(int i) const
|
||||
{
|
||||
Json::Value v(Json::objectValue);
|
||||
typedef std::pair<std::string, Parameter::pointer> string_ref_pair;
|
||||
BOOST_FOREACH(string_ref_pair it, mChildren)
|
||||
typedef std::map<std::string, Parameter::pointer>::value_type string_ref_pair;
|
||||
BOOST_FOREACH(const string_ref_pair& it, mChildren)
|
||||
{
|
||||
v[it.first] = it.second->getValue(i);
|
||||
}
|
||||
@@ -95,8 +95,8 @@ bool ParameterNode::setValue(const Json::Value& value, Json::Value& error)
|
||||
error["error"] = "Cannot end on an inner node";
|
||||
|
||||
Json::Value nodes(Json::arrayValue);
|
||||
typedef std::pair<std::string, Parameter::pointer> string_ref_pair;
|
||||
BOOST_FOREACH(string_ref_pair it, mChildren)
|
||||
typedef std::map<std::string, Parameter::pointer>::value_type string_ref_pair;
|
||||
BOOST_FOREACH(const string_ref_pair& it, mChildren)
|
||||
{
|
||||
nodes.append(it.first);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user