[PATCH] D75604: [clangd] Round WorkDoneProgressBegin.percentage down

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 4 06:11:38 PST 2020


kbobyrev updated this revision to Diff 248164.
kbobyrev added a comment.

%s/ceil/floor/g


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75604/new/

https://reviews.llvm.org/D75604

Files:
  clang-tools-extra/clangd/ClangdLSPServer.cpp


Index: clang-tools-extra/clangd/ClangdLSPServer.cpp
===================================================================
--- clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -1406,6 +1406,8 @@
       WorkDoneProgressReport Report;
       Report.percentage = 100.0 * (Stats.Completed - Stats.LastIdle) /
                           (Stats.Enqueued - Stats.LastIdle);
+      // Round down to 2 decimal places for readability.
+      Report.percentage = std::floor(*Report.percentage * 100.0) / 100.0;
       Report.message =
           llvm::formatv("{0}/{1}", Stats.Completed - Stats.LastIdle,
                         Stats.Enqueued - Stats.LastIdle);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75604.248164.patch
Type: text/x-patch
Size: 698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200304/cc4ddf3f/attachment-0001.bin>


More information about the cfe-commits mailing list