JoelKatz

Untitled

Aug 21st, 2014
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. std::vector<RippleState::pointer> const&
  2. RippleLineCache::getRippleLines (Account const& accountID)
  3. {
  4.  
  5. {
  6. ScopedLockType sl (mLock);
  7.  
  8. auto it = mRLMap.find (accountID);
  9. if (it != mRLMap.end ())
  10. return it->second;
  11. }
  12.  
  13. // It's not in the cache, so build it
  14. auto lines = ripple::getRippleStateItems (accountID, mLedger);
  15.  
  16. {
  17. ScopedLockType sl (mLock);
  18.  
  19. // We must return a reference to the cached version
  20. return mRLMap.emplace (accountID, std::move (lines)).first->second;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment