Reverse find
| 223 | |
| 224 | // Reverse find |
| 225 | fl::size rfind(char ch, fl::size pos = npos) const FL_NOEXCEPT { |
| 226 | if (mSize == 0) return npos; |
| 227 | fl::size search_pos = (pos >= mSize || pos == npos) ? (mSize - 1) : pos; |
| 228 | for (fl::size i = search_pos + 1; i > 0; --i) { |
| 229 | if (mData[i - 1] == ch) { |
| 230 | return i - 1; |
| 231 | } |
| 232 | } |
| 233 | return npos; |
| 234 | } |
| 235 | |
| 236 | fl::size rfind(string_view sv, fl::size pos = npos) const FL_NOEXCEPT { |
| 237 | if (sv.empty()) return (pos > mSize) ? mSize : pos; |
nothing calls this directly
no test coverage detected