From 9032f8dd341317b0446e433e796afd5c8a50de12 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Tue, 9 Nov 2021 22:14:31 +0000 Subject: [PATCH] Use integer division --- edgedb/datatypes/config_memory.pyx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/edgedb/datatypes/config_memory.pyx b/edgedb/datatypes/config_memory.pyx index 7d95d1db..c921ff3a 100644 --- a/edgedb/datatypes/config_memory.pyx +++ b/edgedb/datatypes/config_memory.pyx @@ -51,15 +51,15 @@ cdef class ConfigMemory: int64_t bytes = self.bytes if bytes >= PiB and bytes % PiB == 0: - return f'{int(bytes / PiB)}PiB' + return f'{bytes // PiB}PiB' if bytes >= TiB and bytes % TiB == 0: - return f'{int(bytes / TiB)}TiB' + return f'{bytes // TiB}TiB' if bytes >= GiB and bytes % GiB == 0: - return f'{int(bytes / GiB)}GiB' + return f'{bytes // GiB}GiB' if bytes >= MiB and bytes % MiB == 0: - return f'{int(bytes / MiB)}MiB' + return f'{bytes // MiB}MiB' if bytes >= KiB and bytes % KiB == 0: - return f'{int(bytes / KiB)}KiB' + return f'{bytes // KiB}KiB' return f'{bytes}B' @property