Remove unnecessary copies #205

Merged
bvbfan merged 1 commit from unneeded_copies into master 2018-10-18 23:39:28 +02:00

View file

@ -7,7 +7,7 @@
// Maximum block decrement that is allowed from rpc calls // Maximum block decrement that is allowed from rpc calls
const int MAX_RPC_BLOCK_DECREMENTS = 50; const int MAX_RPC_BLOCK_DECREMENTS = 50;
uint160 ParseClaimtrieId(const UniValue& v, std::string strName) uint160 ParseClaimtrieId(const UniValue& v, const std::string& strName)
{ {
std::string strHex; std::string strHex;
if (v.isStr()) if (v.isStr())
@ -221,8 +221,8 @@ typedef std::map<uint160, std::vector<CSupportValue> > supportsWithoutClaimsMapT
UniValue claimsAndSupportsToJSON(claimSupportMapType::const_iterator itClaimsAndSupports, int nCurrentHeight) UniValue claimsAndSupportsToJSON(claimSupportMapType::const_iterator itClaimsAndSupports, int nCurrentHeight)
{ {
UniValue ret(UniValue::VOBJ); UniValue ret(UniValue::VOBJ);
const CClaimValue claim = itClaimsAndSupports->second.first; const CClaimValue& claim = itClaimsAndSupports->second.first;
const std::vector<CSupportValue> supports = itClaimsAndSupports->second.second; const std::vector<CSupportValue>& supports = itClaimsAndSupports->second.second;
CAmount nEffectiveAmount = 0; CAmount nEffectiveAmount = 0;
UniValue supportObjs(UniValue::VARR); UniValue supportObjs(UniValue::VARR);
for (std::vector<CSupportValue>::const_iterator itSupports = supports.begin(); itSupports != supports.end(); ++itSupports) for (std::vector<CSupportValue>::const_iterator itSupports = supports.begin(); itSupports != supports.end(); ++itSupports)
@ -262,7 +262,7 @@ UniValue claimsAndSupportsToJSON(claimSupportMapType::const_iterator itClaimsAnd
UniValue supportsWithoutClaimsToJSON(supportsWithoutClaimsMapType::const_iterator itSupportsWithoutClaims, int nCurrentHeight) UniValue supportsWithoutClaimsToJSON(supportsWithoutClaimsMapType::const_iterator itSupportsWithoutClaims, int nCurrentHeight)
{ {
const std::vector<CSupportValue> supports = itSupportsWithoutClaims->second; const std::vector<CSupportValue>& supports = itSupportsWithoutClaims->second;
UniValue ret(UniValue::VOBJ); UniValue ret(UniValue::VOBJ);
UniValue supportObjs(UniValue::VARR); UniValue supportObjs(UniValue::VARR);
ret.push_back(Pair("claimId (no matching claim)", itSupportsWithoutClaims->first.GetHex())); ret.push_back(Pair("claimId (no matching claim)", itSupportsWithoutClaims->first.GetHex()));