Merge pull request #9123 from ethereum/fix-tohex-with-empty-data

Fix toHex() in case of empty data and non-empty prefix
This commit is contained in:
chriseth 2020-06-04 12:32:26 +02:00 committed by GitHub
commit 70e6252477
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,9 +53,6 @@ string solidity::util::toHex(uint8_t _data, HexCase _case)
string solidity::util::toHex(bytes const& _data, HexPrefix _prefix, HexCase _case)
{
if (_data.empty())
return {};
std::string ret(_data.size() * 2 + (_prefix == HexPrefix::Add ? 2 : 0), 0);
size_t i = 0;