MCPcopy Create free account
hub / github.com/NativeScript/android / find_authority_delimiter

Function find_authority_delimiter

test-app/runtime/src/main/cpp/ada/ada.cpp:11990–12000  ·  view source on GitHub ↗

credit: @the-moisrex recommended a table-based approach

Source from the content-addressed store, hash-verified

11988}();
11989// credit: @the-moisrex recommended a table-based approach
11990ada_really_inline size_t
11991find_authority_delimiter(std::string_view view) noexcept {
11992 // performance note: we might be able to gain further performance
11993 // with SIMD instrinsics.
11994 for (auto pos = view.begin(); pos != view.end(); ++pos) {
11995 if (authority_delimiter[(uint8_t)*pos]) {
11996 return pos - view.begin();
11997 }
11998 }
11999 return size_t(view.size());
12000}
12001
12002} // namespace ada::helpers
12003

Callers 1

parse_url_implFunction · 0.85

Calls 3

beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected