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

Function percent_encode_index

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

Source from the content-addressed store, hash-verified

7290 */
7291namespace ada::unicode {
7292ada_really_inline size_t percent_encode_index(const std::string_view input,
7293 const uint8_t character_set[]) {
7294 const char* data = input.data();
7295 const size_t size = input.size();
7296
7297 // Process 8 bytes at a time using unrolled loop
7298 size_t i = 0;
7299 for (; i + 8 <= size; i += 8) {
7300 unsigned char chunk[8];
7301 std::memcpy(&chunk, data + i,
7302 8); // entices compiler to unconditionally process 8 characters
7303
7304 // Check 8 characters at once
7305 for (size_t j = 0; j < 8; j++) {
7306 if (character_sets::bit_at(character_set, chunk[j])) {
7307 return i + j;
7308 }
7309 }
7310 }
7311
7312 // Handle remaining bytes
7313 for (; i < size; i++) {
7314 if (character_sets::bit_at(character_set, data[i])) {
7315 return i;
7316 }
7317 }
7318
7319 return size;
7320}
7321} // namespace ada::unicode
7322
7323#endif // ADA_UNICODE_INL_H

Callers 4

update_base_searchMethod · 0.85
set_usernameMethod · 0.85
set_passwordMethod · 0.85
parse_opaque_hostMethod · 0.85

Calls 3

bit_atFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected