From 0eefb331f816a7b19df0c3077024f3b896b39b84 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 22 Nov 2022 14:50:10 +0300 Subject: [PATCH] Improve size formatting. --- tdutils/td/utils/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdutils/td/utils/format.h b/tdutils/td/utils/format.h index 9da152448..0baf9b8be 100644 --- a/tdutils/td/utils/format.h +++ b/tdutils/td/utils/format.h @@ -196,7 +196,7 @@ inline StringBuilder &operator<<(StringBuilder &logger, Size t) { static constexpr size_t sizes_n = sizeof(sizes) / sizeof(NamedValue); size_t i = 0; - while (i + 1 < sizes_n && t.size_ > 10 * sizes[i + 1].value) { + while (i + 1 < sizes_n && t.size_ >= 100000 * sizes[i].value) { i++; } logger << t.size_ / sizes[i].value << Slice(sizes[i].name);