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

Method find_last_of

src/fl/stl/string_view.h:295–306  ·  view source on GitHub ↗

Find last of any character in set

Source from the content-addressed store, hash-verified

293
294 // Find last of any character in set
295 fl::size find_last_of(string_view sv, fl::size pos = npos) const FL_NOEXCEPT {
296 if (mSize == 0 || sv.empty()) return npos;
297 fl::size search_pos = (pos >= mSize || pos == npos) ? (mSize - 1) : pos;
298 for (fl::size i = search_pos + 1; i > 0; --i) {
299 for (fl::size j = 0; j < sv.mSize; ++j) {
300 if (mData[i - 1] == sv.mData[j]) {
301 return i - 1;
302 }
303 }
304 }
305 return npos;
306 }
307
308 fl::size find_last_of(char ch, fl::size pos = npos) const FL_NOEXCEPT {
309 return rfind(ch, pos);

Callers

nothing calls this directly

Calls 2

string_viewClass · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected