MCPcopy Create free account
hub / github.com/FastLED/FastLED / rfind

Method rfind

src/fl/stl/string_view.h:225–234  ·  view source on GitHub ↗

Reverse find

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 2

string_viewClass · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected