diff --git a/src/mapping.cpp b/src/mapping.cpp index 2301a8b..94b89b8 100644 --- a/src/mapping.cpp +++ b/src/mapping.cpp @@ -36,7 +36,7 @@ bool ascii_has_upper_case(char* input, size_t length) { auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; uint64_t broadcast_80 = broadcast(0x80); uint64_t broadcast_Ap = broadcast(128 - 'A'); - uint64_t broadcast_Zp = broadcast(128 - 'Z'); + uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1); size_t i = 0; uint64_t runner{0}; @@ -58,7 +58,7 @@ void ascii_map(char* input, size_t length) { auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; uint64_t broadcast_80 = broadcast(0x80); uint64_t broadcast_Ap = broadcast(128 - 'A'); - uint64_t broadcast_Zp = broadcast(128 - 'Z'); + uint64_t broadcast_Zp = broadcast(128 - 'Z' - 1); size_t i = 0; for (; i + 7 < length; i += 8) { diff --git a/tests/fixtures/to_ascii_alternating.txt b/tests/fixtures/to_ascii_alternating.txt index f69f2ee..66b3f33 100644 --- a/tests/fixtures/to_ascii_alternating.txt +++ b/tests/fixtures/to_ascii_alternating.txt @@ -1,3 +1,5 @@ +AMAZON +amazon aa-- aa-- a†--