27 sep. 2020 kl. 02.03 skrev Lars Ingebrigtsen : > *phew* Not bad! This seems to work all right. Here are some minor optimisations: - Do the fast all-ASCII test (bytes == chars) before iterating through the bytes to check for non-ASCII chars. - Faster check for non-ASCII non-raw bytes (no need for the complex code in string_char_advance). It is tempting to vectorise the all-ASCII loop. Maybe another day... The patch also adds some more test cases for completeness.