Skip to content

Commit

Permalink
Remove unnecessary branches in utilstrencodings string constructors.
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRubin authored and furszy committed May 8, 2021
1 parent 25a16b3 commit 8e2e79e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utilstrencodings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ std::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)
std::string DecodeBase64(const std::string& str)
{
std::vector<unsigned char> vchRet = DecodeBase64(str.c_str());
return (vchRet.size() == 0) ? std::string() : std::string((const char*)vchRet.data(), vchRet.size());
return std::string((const char*)vchRet.data(), vchRet.size());
}

// Base64 encoding with secure memory allocation
Expand Down Expand Up @@ -286,7 +286,7 @@ std::vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid)
std::string DecodeBase32(const std::string& str)
{
std::vector<unsigned char> vchRet = DecodeBase32(str.c_str());
return (vchRet.size() == 0) ? std::string() : std::string((const char*) vchRet.data(), vchRet.size());
return std::string((const char*)vchRet.data(), vchRet.size());
}

static bool ParsePrechecks(const std::string& str)
Expand Down

0 comments on commit 8e2e79e

Please sign in to comment.