Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove unused indices in `mac/text_system` (#40420)
Andrew Farkasc288f9b1e611
diff --git a/crates/gpui/src/platform/mac/text_system.rs b/crates/gpui/src/platform/mac/text_system.rsindex 4dfdee2135c..b812c969530 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<String, FontId>,font_ids_by_font_key: HashMap<FontKey, SmallVec<[FontId; 4]>>,postscript_names_by_font_id: HashMap<FontId, String>,- zwnjs_scratch_space: Vec<(usize, usize)>,+ /// UTF-16 indices of ZWNJS+ zwnjs_scratch_space: Vec<usize>,}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 itOk(_) => continue,