mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 19:14:14 +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();
|
out << "EMPTY->" << it.data();
|
||||||
else {
|
else {
|
||||||
const slice root(it.head(std::min(it.length(), size_t(64))));
|
const slice root(it.head(std::min(it.length(), size_t(64))));
|
||||||
out << it.length() << "->"
|
out << it.length() << ".";
|
||||||
<< (root.is_printable() ? root.string() : root.base58_encode())
|
if (root.is_printable())
|
||||||
<< ((root == it) ? "" : "...");
|
(out << "\"").write(root.char_ptr(), root.length()) << "\"";
|
||||||
|
else
|
||||||
|
out << root.base58_encode();
|
||||||
|
if (root.length() < it.length())
|
||||||
|
out << "...";
|
||||||
}
|
}
|
||||||
return out << "}";
|
return out << "}";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user