[PATCH] D47406: [ADT] Add `StringRef::rsplit(StringRef Separator)`.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 3 17:37:00 PDT 2018


rsplit(char) already exists. That said, another way to reuse code would be
to have rsplit(char) call the StringRef version
On Sun, Jun 3, 2018 at 5:28 PM Vedant Kumar via Phabricator <
reviews at reviews.llvm.org> wrote:

> vsk requested changes to this revision.
> vsk added a comment.
> This revision now requires changes to proceed.
>
> Hi @MTC, thanks for the patch.
>
> With this patch, the logic for split would be duplicated 3 times now in
> StringRef.h. I think it'd be nice to reuse some code by moving the core
> logic into a private method of StringRef, say, `splitAtIndex(size_t)`.
> Then, each (r)split(char | StringRef) can use the common helper.
>
> Relatedly, an rsplit(char) overload seems to be missing here.
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D47406
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180603/ef877a66/attachment-0001.html>


More information about the llvm-commits mailing list