Review feedback from @yinyiqian1

- Rewrite to_short_string to call strHex directly instead of building
  the whole hex string first.
- Change PrettyAsset::scale_ back to a uint32 since the Number
  conversion elides any potential multiplication overflow.
- Clean ups.
This commit is contained in:
Ed Hennis
2025-09-05 17:41:06 -04:00
parent 76ae61feb5
commit f0c96ccfe6
4 changed files with 8 additions and 4 deletions

View File

@@ -636,7 +636,12 @@ template <std::size_t Bits, class Tag>
inline std::string
to_short_string(base_uint<Bits, Tag> const& a)
{
return to_string(a).substr(0, 8) + "...";
// LCOV_EXCL_START
if constexpr (a.bytes <= 4)
return to_string(a);
else
// LCOV_EXCL_STOP
return strHex(a.cbegin(), a.cbegin() + 4) + "...";
}
template <std::size_t Bits, class Tag>