mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-30 11:29:19 +08:00
mdbx++: refine operator<<(ostream, pair)
.
Change-Id: I0f42c17a241cf4e2ed6ae8f18e84a13ba5500a3b
This commit is contained in:
parent
4e198915f2
commit
e3f32ec6b4
10
src/mdbx.c++
10
src/mdbx.c++
@ -1282,9 +1282,13 @@ __cold ::std::ostream &operator<<(::std::ostream &out, const slice &it) {
|
||||
out << "EMPTY->" << it.data();
|
||||
else {
|
||||
const slice root(it.head(std::min(it.length(), size_t(64))));
|
||||
out << it.length() << "->"
|
||||
<< (root.is_printable() ? root.string() : root.base58_encode())
|
||||
<< ((root == it) ? "" : "...");
|
||||
out << it.length() << ".";
|
||||
if (root.is_printable())
|
||||
(out << "\"").write(root.char_ptr(), root.length()) << "\"";
|
||||
else
|
||||
out << root.base58_encode();
|
||||
if (root.length() < it.length())
|
||||
out << "...";
|
||||
}
|
||||
return out << "}";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user