psigillito marked 7 inline comments as done.
psigillito added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2716-2718
+  auto COperatorMatch =
+      std::lower_bound(COperatorsFollowingVar.begin(),
+                       COperatorsFollowingVar.end(), FormatTok->Tok.getKind());
----------------
curdeius wrote:
> Please use `binary_search` and put it inside the `else` branch to avoid it if 
> the first condition is satisfied.
> Something like:
> ```
> if (FormatTok->Tok.is(tok::colon)) {
> ...
> } else if (!binary_search(...) {
> } else if (...) {
> }
> ```
> 
> Also, this code and the code in `UnwrappedLineFormatter` are pretty much 
> similar.
> Can we remove this duplication by e.g. setting the token kind here and 
> checking it in the formatter?
Yes, since we now set the kind to 'identifier' here, the binary_search check in 
the formatter is unnecessary. Updated the formatter to no longer do the check. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117416

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to