From 3816c4bb39d3f0aaaef787a69ec914076391eee7 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 14 Mar 2020 13:34:31 +0100 Subject: [PATCH] Add comment about rounding in timer and appease clang-format --- src/fish_tests.cpp | 8 ++++---- src/timer.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 581195ff9..8d574f151 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -5662,10 +5662,10 @@ ________________________________________________________ Executed in 500.00 micros fish external usr time 1.00 secs 1.00 secs 1.00 millis sys time 1.00 secs 1.00 secs 0.50 millis -)"; // (a) (b) (c) - // (a) remaining columns should align even if there are different units - // (b) carry to the next unit when it would overflow %6.2F - // (c) carry to the next unit when the larger one exceeds 1000 +)"; // (a) (b) (c) + // (a) remaining columns should align even if there are different units + // (b) carry to the next unit when it would overflow %6.2F + // (c) carry to the next unit when the larger one exceeds 1000 std::wstring actual = timer_snapshot_t::print_delta(t1, t2, true); if (actual != expected) { err(L"Failed to format timer snapshot\n\Expected: %ls\nActual:%ls\n", expected, diff --git a/src/timer.cpp b/src/timer.cpp index 250bf79e3..8ebae52dc 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -101,7 +101,7 @@ wcstring timer_snapshot_t::print_delta(timer_snapshot_t t1, timer_snapshot_t t2, auto get_unit = [](int64_t micros) { if (micros > 900 * 1E6) { return tunit::minutes; - } else if (micros >= 999995) { + } else if (micros >= 999995) { // Move to seconds if we would overflow the %6.2 format. return tunit::seconds; } else if (micros >= 1000) { return tunit::milliseconds;