[llvm-commits] [llvm] r82343 - /llvm/trunk/include/llvm/ADT/StringRef.h
Chris Lattner
sabre at nondot.org
Sun Sep 20 15:54:37 PDT 2009
On Sep 20, 2009, at 2:23 PM, Daniel Dunbar wrote:
>> /// found.
>> - size_t rfind(char C) const {
>> - for (size_t i = Length, e = 0; i != e;) {
>> + size_t rfind(char C, size_t From) const {
>> + for (size_t i = From, e = 0; i != e;) {
>> --i;
>> if (Data[i] == C)
>> return i;
>> }
>> return npos;
>> }
>> +
>> + size_t rfind(char C) const {
>> + return rfind(C, Length);
>> + }
>> +
>
> To be in line with the current API, this should be one method with the
> default argument for From being StringRef::npos, and the starting
> position should be the minimum of the current Length and the From
> argument.
Done, thanks.
-Chris
More information about the llvm-commits
mailing list