MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / find

Method find

source/core/StarStringView.cpp:175–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175size_t StringView::find(Char c, size_t pos, CaseSensitivity cs) const {
176 auto it = begin();
177 for (size_t i = 0; i < pos; ++i) {
178 if (it == end())
179 break;
180 ++it;
181 }
182
183 while (it != end()) {
184 if (String::charEqual(c, *it, cs))
185 return pos;
186 ++pos;
187 ++it;
188 }
189
190 return NPos;
191}
192
193size_t StringView::find(StringView str, size_t pos, CaseSensitivity cs) const {
194 if (str.empty())

Callers 1

forEachSplitViewMethod · 0.45

Calls 5

beginFunction · 0.85
endFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected