From 506b700dcb5dd5a7c1d8ffa7c77043a93e4e10de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Wed, 29 Mar 2017 17:51:41 +0200 Subject: Util: Remove redundant calls to gArgs.IsArgSet() Return empty std::vector with ArgsManager::GetArgs if nothing is set for that string --- src/httprpc.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/httprpc.cpp') diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 053702f84..3f030fce5 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -92,10 +92,8 @@ static bool multiUserAuthorized(std::string strUserPass) std::string strUser = strUserPass.substr(0, strUserPass.find(":")); std::string strPass = strUserPass.substr(strUserPass.find(":") + 1); - if (gArgs.IsArgSet("-rpcauth")) { + for (const std::string& strRPCAuth : gArgs.GetArgs("-rpcauth")) { //Search for multi-user login/pass "rpcauth" from config - for (std::string strRPCAuth : gArgs.GetArgs("-rpcauth")) - { std::vector vFields; boost::split(vFields, strRPCAuth, boost::is_any_of(":$")); if (vFields.size() != 3) { @@ -121,7 +119,6 @@ static bool multiUserAuthorized(std::string strUserPass) if (TimingResistantEqual(strHashFromPass, strHash)) { return true; } - } } return false; } -- cgit v1.2.3