From c288f9b1e61173e0dad54364c04758be8ffd8658 Mon Sep 17 00:00:00 2001 From: Andrew Farkas <6060305+HactarCE@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:28:36 -0400 Subject: [PATCH] Remove unused indices in `mac/text_system` (#40420) just simplifying the code a bit Release Notes: - N/A Co-authored-by: Cole Miller --- crates/gpui/src/platform/mac/text_system.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/gpui/src/platform/mac/text_system.rs b/crates/gpui/src/platform/mac/text_system.rs index 4dfdee2135ce71bff46fefab0edd6a4a97c183d9..b812c969530f2a2178e6d12b87168ca0100a0596 100644 --- a/crates/gpui/src/platform/mac/text_system.rs +++ b/crates/gpui/src/platform/mac/text_system.rs @@ -67,7 +67,8 @@ struct MacTextSystemState { font_ids_by_postscript_name: HashMap, font_ids_by_font_key: HashMap>, postscript_names_by_font_id: HashMap, - zwnjs_scratch_space: Vec<(usize, usize)>, + /// UTF-16 indices of ZWNJS + zwnjs_scratch_space: Vec, } impl MacTextSystem { @@ -457,7 +458,7 @@ impl MacTextSystemState { string.replace_str(&CFString::new(text), CFRange::init(utf16_start, 0)); if needs_zwnj { let zwnjs_pos = string.char_len(); - self.zwnjs_scratch_space.push((n_zwnjs, zwnjs_pos as usize)); + self.zwnjs_scratch_space.push(zwnjs_pos as usize); string.replace_str( &CFString::from_static_string(ZWNJ_STR), CFRange::init(zwnjs_pos, 0), @@ -516,7 +517,7 @@ impl MacTextSystemState { let mut glyph_utf16_ix = usize::try_from(glyph_utf16_ix).unwrap(); let r = self .zwnjs_scratch_space - .binary_search_by(|&(_, it)| it.cmp(&glyph_utf16_ix)); + .binary_search_by(|&it| it.cmp(&glyph_utf16_ix)); match r { // this glyph is a ZWNJ, skip it Ok(_) => continue,