poelmanc marked an inline comment as done.
poelmanc added inline comments.
================
Comment at: clang/include/clang/Basic/CharInfo.h:94
+LLVM_READONLY inline bool isWhitespace(llvm::StringRef S) {
+ for (StringRef::const_iterator I = S.begin(), E = S.end(); I != E; ++I) {
+ if (!isWhitespace(*I))
----------------
alexfh wrote:
> I'd suggest to avoid overloading here. A name like `isWhitespaceOnly` would
> be less ambiguous.
>
> As for implementation, it can be less verbose:
> ```
> for (char C : S)
> if (!isWhitespace(*I))
> return false;
> return true;
> ```
> or just
> ```
> return llvm::all_of(S, isWhitespace);
> ```
Thanks for the suggestion, I've removed the overloading and updated the
implementation.
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68682/new/
https://reviews.llvm.org/D68682
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits