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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 3 17:28:45 PDT 2018


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





More information about the llvm-commits mailing list