Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
rodiazet committed Feb 6, 2023
1 parent eaf88a8 commit f280368
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/statetest/statetest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ namespace utils

inline std::string shortest_hex(uint64_t v, bool add_prefix = true)
{
if (v == 0) {
if (v == 0)
{
return add_prefix ? "0x0" : "0";
}

Expand All @@ -93,7 +94,8 @@ inline std::string shortest_hex(uint64_t v, bool add_prefix = true)
value += evmc::hex(static_cast<uint8_t>(v >> 8 * (8 - i - 1)));

// String leading zeroes.
if (size_t pos = value.find_first_not_of("0"); pos != std::string::npos) {
if (size_t pos = value.find_first_not_of("0"); pos != std::string::npos)
{
value = value.substr(pos);
}
return (add_prefix ? "0x" : "") + value;
Expand Down

0 comments on commit f280368

Please sign in to comment.