[PATCH] D138378: [clang-format][NFC] Skip unneeded calculations

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 21 04:21:56 PST 2022


HazardyKnusperkeks added inline comments.


================
Comment at: clang/lib/Format/WhitespaceManager.cpp:1434-1436
+      if (Style.UseTab == FormatStyle::UT_Never) {
+        ReplacementText.append(Spaces, ' ');
+      } else {
----------------
owenpan wrote:
> Doing this would lose some of the abstraction we have now without any gain in performance? Then we should leave it (and `appendIndentText` below) as is.
The `UT_Never` case would be faster, if that would be measurable I don't know.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138378



More information about the cfe-commits mailing list