From 9e7275c5dfeb9400492ceb8bed6635208a3d3cda Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 1 Sep 2017 17:03:23 -0700 Subject: [PATCH] [vcpkg_Chrono] Add missing consts --- toolsrc/src/vcpkg_Chrono.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/toolsrc/src/vcpkg_Chrono.cpp b/toolsrc/src/vcpkg_Chrono.cpp index d70f4a0541d..d96f3098774 100644 --- a/toolsrc/src/vcpkg_Chrono.cpp +++ b/toolsrc/src/vcpkg_Chrono.cpp @@ -7,43 +7,43 @@ namespace vcpkg { static std::string format_time_userfriendly(const std::chrono::nanoseconds& nanos) { - using std::chrono::hours; - using std::chrono::minutes; - using std::chrono::seconds; - using std::chrono::milliseconds; - using std::chrono::microseconds; - using std::chrono::nanoseconds; using std::chrono::duration_cast; + using std::chrono::hours; + using std::chrono::microseconds; + using std::chrono::milliseconds; + using std::chrono::minutes; + using std::chrono::nanoseconds; + using std::chrono::seconds; const double nanos_as_double = static_cast(nanos.count()); if (duration_cast(nanos) > hours()) { - auto t = nanos_as_double / duration_cast(hours(1)).count(); + const auto t = nanos_as_double / duration_cast(hours(1)).count(); return Strings::format("%.4g h", t); } if (duration_cast(nanos) > minutes()) { - auto t = nanos_as_double / duration_cast(minutes(1)).count(); + const auto t = nanos_as_double / duration_cast(minutes(1)).count(); return Strings::format("%.4g min", t); } if (duration_cast(nanos) > seconds()) { - auto t = nanos_as_double / duration_cast(seconds(1)).count(); + const auto t = nanos_as_double / duration_cast(seconds(1)).count(); return Strings::format("%.4g s", t); } if (duration_cast(nanos) > milliseconds()) { - auto t = nanos_as_double / duration_cast(milliseconds(1)).count(); + const auto t = nanos_as_double / duration_cast(milliseconds(1)).count(); return Strings::format("%.4g ms", t); } if (duration_cast(nanos) > microseconds()) { - auto t = nanos_as_double / duration_cast(microseconds(1)).count(); + const auto t = nanos_as_double / duration_cast(microseconds(1)).count(); return Strings::format("%.4g us", t); }