Updated map creation logic

This commit is contained in:
Dylan Bulfin 2022-12-12 11:03:24 -05:00
parent a677e9b53a
commit f9a03d1b75
No known key found for this signature in database

View File

@ -683,11 +683,7 @@ pub fn render_bufferline(editor: &Editor, viewport: Rect, surface: &mut Surface)
.to_str()
.unwrap_or_default();
if names_map.contains_key(fname) {
names_map.insert(fname, names_map.get(fname).unwrap() + 1);
} else {
names_map.insert(fname, 1);
}
*names_map.entry(fname).or_insert(0) += 1;
}
for doc in editor.documents() {