mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 06:54:45 +03:00
fonts: pre-size some vecs
micro optimization really
This commit is contained in:
parent
a2b068d59f
commit
8953bff276
@ -50,7 +50,7 @@ where
|
||||
infos: &[GlyphInfo],
|
||||
glyphs: &[Rc<CachedGlyph<T>>],
|
||||
) -> Vec<ShapedInfo<T>> {
|
||||
let mut pos: Vec<Option<ShapedInfo<T>>> = vec![];
|
||||
let mut pos: Vec<Option<ShapedInfo<T>>> = Vec::with_capacity(infos.len());
|
||||
let mut x = 0.;
|
||||
let mut prior_info: Option<&GlyphInfo> = None;
|
||||
|
||||
|
@ -1275,7 +1275,7 @@ impl super::TermWindow {
|
||||
glyph_cache: &mut GlyphCache<SrgbTexture2d>,
|
||||
infos: &[GlyphInfo],
|
||||
) -> anyhow::Result<Vec<Rc<CachedGlyph<SrgbTexture2d>>>> {
|
||||
let mut glyphs = vec![];
|
||||
let mut glyphs = Vec::with_capacity(infos.len());
|
||||
for info in infos {
|
||||
let cell_idx = cluster.byte_to_cell_idx[info.cluster as usize];
|
||||
let followed_by_space = match line.cells().get(cell_idx + 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user