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

Method rfind

src/fl/stl/basic_string.cpp.hpp:554–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552// ======= RFIND =======
553
554fl::size basic_string::rfind(char c, fl::size pos) const {
555 if (mLength == 0) return npos;
556 fl::size searchPos = (pos >= mLength || pos == npos) ? (mLength - 1) : pos;
557 const char* str = c_str();
558 for (fl::size i = searchPos + 1; i > 0; --i) {
559 if (str[i - 1] == c) return i - 1;
560 }
561 return npos;
562}
563
564fl::size basic_string::rfind(const char* s, fl::size pos, fl::size count) const {
565 if (!s || count == 0) {

Callers 4

run_benchmarkMethod · 0.45
_normalize_includeFunction · 0.45
FL_TEST_FILEFunction · 0.45
FL_TEST_FILEFunction · 0.45

Calls 3

strlenFunction · 0.85
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected