From 431e7179ac9dcd4b5898ef5cbf90a755708b3c51 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 6 Jun 2019 00:20:57 +0800 Subject: [PATCH] Remove redundant variable --- src/base/utils/misc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/base/utils/misc.cpp b/src/base/utils/misc.cpp index c10c5fd2e..6514abf8f 100644 --- a/src/base/utils/misc.cpp +++ b/src/base/utils/misc.cpp @@ -80,13 +80,13 @@ namespace if (sizeInBytes < 0) return false; int i = 0; - auto rawVal = static_cast(sizeInBytes); + val = static_cast(sizeInBytes); - while ((rawVal >= 1024.) && (i <= static_cast(Utils::Misc::SizeUnit::ExbiByte))) { - rawVal /= 1024.; + while ((val >= 1024.) && (i <= static_cast(Utils::Misc::SizeUnit::ExbiByte))) { + val /= 1024.; ++i; } - val = rawVal; + unit = static_cast(i); return true; }