From 65fe26dc6c6545aeb48fdf9531d51969899af6b0 Mon Sep 17 00:00:00 2001 From: XMRig Date: Thu, 28 Jan 2021 00:00:00 +0700 Subject: [PATCH] Don't print empty memory slots if the total count above 8. --- src/Summary.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Summary.cpp b/src/Summary.cpp index eaee89bf..39b37ac0 100644 --- a/src/Summary.cpp +++ b/src/Summary.cpp @@ -146,7 +146,7 @@ static void print_memory(const Config *config) return; } - const bool vm = Cpu::info()->isVM(); + const bool printEmpty = reader.memory().size() <= 8; for (const auto &memory : reader.memory()) { if (!memory.isValid()) { @@ -157,12 +157,12 @@ static void print_memory(const Config *config) Log::print(WHITE_BOLD(" %-13s") "%s: " CYAN_BOLD("%" PRIu64) CYAN(" GB ") WHITE_BOLD("%s @ %" PRIu64 " MHz ") BLACK_BOLD("%s"), "", memory.slot().data(), memory.size() / oneGiB, memory.type(), memory.speed() / 1000000ULL, memory.product().data()); } - else if (!vm) { + else if (printEmpty) { Log::print(WHITE_BOLD(" %-13s") "%s: " BLACK_BOLD(""), "", memory.slot().data()); } } - const auto &board = vm ? reader.system() : reader.board(); + const auto &board = Cpu::info()->isVM() ? reader.system() : reader.board(); if (board.isValid()) { Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") WHITE_BOLD("%s") " - " WHITE_BOLD("%s"), "MOTHERBOARD", board.vendor().data(), board.product().data());