| 8007 | } |
| 8008 | |
| 8009 | static constexpr int32_t adapt(int32_t d, int32_t n, bool firsttime) { |
| 8010 | if (firsttime) { |
| 8011 | d = d / damp; |
| 8012 | } else { |
| 8013 | d = d / 2; |
| 8014 | } |
| 8015 | d += d / n; |
| 8016 | int32_t k = 0; |
| 8017 | while (d > ((base - tmin) * tmax) / 2) { |
| 8018 | d /= base - tmin; |
| 8019 | k += base; |
| 8020 | } |
| 8021 | return k + (((base - tmin + 1) * d) / (d + skew)); |
| 8022 | } |
| 8023 | |
| 8024 | bool punycode_to_utf32(std::string_view input, std::u32string &out) { |
| 8025 | // See https://github.com/whatwg/url/issues/803 |
no outgoing calls
no test coverage detected