From 15788075035aba6525855056b4b3c28b17073c74 Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Wed, 19 Sep 2018 10:44:18 +0300 Subject: [PATCH] Remove unnecessary copies Signed-off-by: Anthony Fieroni --- src/rpc/claimtrie.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rpc/claimtrie.cpp b/src/rpc/claimtrie.cpp index 252de232b..b0b3d0d49 100644 --- a/src/rpc/claimtrie.cpp +++ b/src/rpc/claimtrie.cpp @@ -7,7 +7,7 @@ // Maximum block decrement that is allowed from rpc calls 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; if (v.isStr()) @@ -221,8 +221,8 @@ typedef std::map > supportsWithoutClaimsMapT UniValue claimsAndSupportsToJSON(claimSupportMapType::const_iterator itClaimsAndSupports, int nCurrentHeight) { UniValue ret(UniValue::VOBJ); - const CClaimValue claim = itClaimsAndSupports->second.first; - const std::vector supports = itClaimsAndSupports->second.second; + const CClaimValue& claim = itClaimsAndSupports->second.first; + const std::vector& supports = itClaimsAndSupports->second.second; CAmount nEffectiveAmount = 0; UniValue supportObjs(UniValue::VARR); for (std::vector::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) { - const std::vector supports = itSupportsWithoutClaims->second; + const std::vector& supports = itSupportsWithoutClaims->second; UniValue ret(UniValue::VOBJ); UniValue supportObjs(UniValue::VARR); ret.push_back(Pair("claimId (no matching claim)", itSupportsWithoutClaims->first.GetHex()));