From d12b4d9d2359c9216ad5977a60de85aea865a92b Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Tue, 16 Nov 2021 21:58:12 +0100 Subject: readability --- src/freebsd/btop_collect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/freebsd/btop_collect.cpp b/src/freebsd/btop_collect.cpp index 5ffb7a5..f8f2a6b 100644 --- a/src/freebsd/btop_collect.cpp +++ b/src/freebsd/btop_collect.cpp @@ -481,9 +481,9 @@ namespace Mem { if (devstat_getdevs(NULL, &cur) != -1) { for (int i = 0; i < cur.dinfo->numdevs; i++) { - devstat_compute_statistics(&cur.dinfo->devices[i], NULL, etime, DSM_TOTAL_BYTES_READ, &total_bytes_read, - DSM_TOTAL_BYTES_WRITE, &total_bytes_write, DSM_NONE); - Logger::debug("dev " + string(cur.dinfo->devices[i].device_name) + std::to_string(cur.dinfo->devices[i].device_number) + " read=" + std::to_string(total_bytes_read) + " write=" + std::to_string(total_bytes_write)); + auto d = cur.dinfo->devices[i]; + devstat_compute_statistics(&d, NULL, etime, DSM_TOTAL_BYTES_READ, &total_bytes_read, DSM_TOTAL_BYTES_WRITE, &total_bytes_write, DSM_NONE); + Logger::debug("dev " + string(d.device_name) + std::to_string(d.device_number) + " read=" + std::to_string(total_bytes_read) + " write=" + std::to_string(total_bytes_write)); } Logger::debug(""); } -- cgit v1.2.3