[PATCH] D103361: [Rust][Demangle] Parse dyn-trait

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 1 16:25:07 PDT 2021


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Looks good, thanks!



================
Comment at: llvm/lib/Demangle/RustDemangle.cpp:548-550
+  for (size_t I = 0; !Error && !consumeIf('E'); ++I) {
+    if (I > 0)
+      print(" + ");
----------------
This could be:
```
bool First = true;
while (!Error && !consumeIf('E'))
  if (First)
    print(" + ");
  First = false; // this could go inside the `if` above, or not - whichever seems more readable
  ...
```

Avoiding the increment on every iteration - I guess it'll probably optimize down to the same anyway, hopefully. So up to you if you reckon that might be more readable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103361



More information about the llvm-commits mailing list