Fix toHex() in case of empty data and non-empty prefix

This commit is contained in:
Kamil Śliwak 2020-06-04 10:01:55 +02:00
parent 6b5f83cdfa
commit 4fd55ae397

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) 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); std::string ret(_data.size() * 2 + (_prefix == HexPrefix::Add ? 2 : 0), 0);
size_t i = 0; size_t i = 0;