diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 19:41:47 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-13 19:41:47 +0300 |
| commit | 1b52f704a005d79d00b1260b1e5bc5d6798ff7b6 (patch) | |
| tree | 798c93f1007d0156635d9db63d47ae9a6328dd80 /src/input.c | |
| parent | 01e1c61e9fcf4a0b0164a7fe5395a209a50f6905 (diff) | |
Replace scalar loops with SIMD spans, packed stores, and direct wrap-pad checks
Diffstat (limited to 'src/input.c')
| -rw-r--r-- | src/input.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/input.c b/src/input.c index 798ffc0..960f488 100644 --- a/src/input.c +++ b/src/input.c @@ -716,11 +716,10 @@ struct term_input_result term_input_encode_paste(const struct term_modes *m, size_t body = sb_len(&sb, buf); for (size_t i = 0; i < len;) { if (sb.overflow) break; - size_t start = i; - while (i < len && (unsigned char)text[i] >= 0x20 && (unsigned char)text[i] < 0x7f) - i++; - if (i > start) { - sb_bytes(&sb, text + start, i - start); + size_t run = term_scan_printable_span(text + i, len - i, 0x7f); + if (run > 0) { + sb_bytes(&sb, text + i, run); + i += run; continue; } unsigned char c = (unsigned char)text[i]; |
