[libc-commits] [PATCH] D97330: [libc] Add a standalone flavor of an equivalent of std::string_view.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Feb 23 15:23:15 PST 2021


sivachandra marked an inline comment as done.
sivachandra added inline comments.


================
Comment at: libc/utils/CPP/StringView.h:70
+    size_t SuffixLen = 0;
+    const char *NewEnd = Data + Len - 1;
+    for (; SuffixLen < Len; --NewEnd, ++SuffixLen) {
----------------
lntue wrote:
> I think we need early exit when Data == nullptr, since it will reach here in that case.
Ah, good catch! Fixed now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97330



More information about the libc-commits mailing list