Use new MetaView functionality in RippleCalc (RIPD-954):

RippleCalc is changed to stack views when calculating results
instead of making a copy of the MetaView, improving efficiency.
This commit is contained in:
JoelKatz
2015-06-23 10:31:35 -07:00
committed by Vinnie Falco
parent 2f485672fa
commit f535304e1b
11 changed files with 89 additions and 65 deletions

View File

@@ -147,5 +147,16 @@ void DeferredCredits::clear ()
map_.clear ();
}
void DeferredCredits::merge (std::pair <Key, Value> const& p)
{
using std::get;
auto r = map_.emplace(p);
if (!r.second)
{
get<0>(r.first->second) += get<0>(p.second);
get<1>(r.first->second) += get<1>(p.second);
}
}
} // ripple