From 4b1c0f2e2e870a3285811bd7b68e14c2edd6a827 Mon Sep 17 00:00:00 2001 From: Jeremy Rubin Date: Tue, 28 Mar 2017 11:17:07 -0400 Subject: [PATCH] Remove unnecessary branches in utilstrencodings string constructors. --- src/utilstrencodings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index feaf1a5e8b..2fabb8cf7a 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -228,7 +228,7 @@ std::vector DecodeBase64(const char* p, bool* pfInvalid) std::string DecodeBase64(const std::string& str) { std::vector 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()); } std::string EncodeBase32(const unsigned char* pch, size_t len) @@ -415,7 +415,7 @@ std::vector DecodeBase32(const char* p, bool* pfInvalid) std::string DecodeBase32(const std::string& str) { std::vector 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)