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

Method compare

src/fl/stl/string_view.h:154–163  ·  view source on GitHub ↗

======= COMPARISON OPERATIONS =======

Source from the content-addressed store, hash-verified

152
153 // ======= COMPARISON OPERATIONS =======
154 int compare(string_view other) const FL_NOEXCEPT {
155 fl::size min_len = (mSize < other.mSize) ? mSize : other.mSize;
156 for (fl::size i = 0; i < min_len; ++i) {
157 if (mData[i] < other.mData[i]) return -1;
158 if (mData[i] > other.mData[i]) return 1;
159 }
160 if (mSize < other.mSize) return -1;
161 if (mSize > other.mSize) return 1;
162 return 0;
163 }
164
165 int compare(fl::size pos1, fl::size count1, string_view other) const FL_NOEXCEPT {
166 return substr(pos1, count1).compare(other);

Callers 6

operator==Function · 0.45
operator!=Function · 0.45
operator<Function · 0.45
operator<=Function · 0.45
operator>Function · 0.45
operator>=Function · 0.45

Calls 2

string_viewClass · 0.70
substrMethod · 0.45

Tested by

no test coverage detected