find_last_of - Find the last character in the string that is in \arg C, or npos if not found. Note: O(size() + Chars.size())
| 275 | /// |
| 276 | /// Note: O(size() + Chars.size()) |
| 277 | StringRef::size_type StringRef::find_last_of(StringRef Chars, |
| 278 | size_t From) const { |
| 279 | std::bitset<1 << CHAR_BIT> CharBits; |
| 280 | for (size_type i = 0; i != Chars.size(); ++i) |
| 281 | CharBits.set((unsigned char)Chars[i]); |
| 282 | |
| 283 | for (size_type i = std::min(From, Length) - 1, e = -1; i != e; --i) |
| 284 | if (CharBits.test((unsigned char)Data[i])) |
| 285 | return i; |
| 286 | return npos; |
| 287 | } |
| 288 | |
| 289 | /// find_last_not_of - Find the last character in the string that is not |
| 290 | /// \arg C, or npos if not found. |
no test coverage detected