mprobst added inline comments.
================ Comment at: lib/Format/BreakableToken.cpp:688 + if (DelimitersOnNewline) { + StringRef TrimmedContent = Content.back().substr(TailOffset).rtrim(Blanks); + if (!TrimmedContent.empty()) { ---------------- Can you add a comment on what this is doing? It's non obvious. Make sure to document both intention (why) and implementation (how). ================ Comment at: lib/Format/BreakableToken.cpp:688 + if (DelimitersOnNewline) { + StringRef TrimmedContent = Content.back().substr(TailOffset).rtrim(Blanks); + if (!TrimmedContent.empty()) { ---------------- mprobst wrote: > Can you add a comment on what this is doing? It's non obvious. Make sure to > document both intention (why) and implementation (how). I don't understand why we're trimming `Content.back()` here, and `Lines.back()` below. ================ Comment at: lib/Format/BreakableToken.cpp:690 + if (!TrimmedContent.empty()) { + size_t Whitespaces = + Lines.back().size() - Lines.back().rtrim(Blanks).size(); ---------------- `Whitespaces` seems like a bad variable name, isn't this rather the index of trimmed whitespace in the last line? https://reviews.llvm.org/D36359 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits