0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

modules/console: Omit zero values in db infos.

This commit is contained in:
Jason Volk 2018-12-12 09:36:02 -08:00
parent c9e9fd3621
commit 7f7ece5fb1

View file

@ -3216,12 +3216,16 @@ try
(const string_view &prop)
{
const auto name(lstrip(prop, "rocksdb."));
closeout(name, [&out, &d, &c, &prop]
const auto val
{
if(c)
out << db::property(c, prop);
else
out << db::property(d, prop);
c?
db::property<db::prop_int>(c, prop):
db::property<db::prop_int>(d, prop)
};
if(!!val) closeout(name, [&out, &val]
{
out << val;
});
}};
@ -3229,12 +3233,16 @@ try
(const string_view &prop)
{
const auto name(lstrip(prop, "rocksdb."));
closeout(name, [&out, &d, &c, &prop]
const auto val
{
if(c)
out << pretty(iec(db::property<db::prop_int>(c, prop)));
else
out << pretty(iec(db::property(d, prop)));
c?
db::property<db::prop_int>(c, prop):
db::property<db::prop_int>(d, prop)
};
if(!!val) closeout(name, [&out, &val]
{
out << pretty(iec(val));
});
}};