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

Function get_special_port

test-app/runtime/src/main/cpp/ada/ada.h:6109–6120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6107 return (target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1));
6108}
6109constexpr uint16_t get_special_port(std::string_view scheme) noexcept {
6110 if (scheme.empty()) {
6111 return 0;
6112 }
6113 int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7;
6114 const std::string_view target = details::is_special_list[hash_value];
6115 if ((target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1))) {
6116 return details::special_ports[hash_value];
6117 } else {
6118 return 0;
6119 }
6120}
6121constexpr uint16_t get_special_port(ada::scheme::type type) noexcept {
6122 return details::special_ports[int(type)];
6123}

Callers 5

parse_url_pattern_implFunction · 0.85
get_special_portMethod · 0.85
scheme_default_portMethod · 0.85
parse_schemeMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected