diff options
author | Lucas Timmins <timmins.s.lucas@gmail.com> | 2018-09-02 21:29:17 +0800 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-09-05 09:02:12 -0700 |
commit | 865727c062810e29fa33b5c04bb05510e7da3ddf (patch) | |
tree | bcd074c1a507884d72ce093958a1710f4151a5f6 | |
parent | 1adb5cb7fc05054197aa08e0d1fa957df94888ab (diff) | |
download | alacritty-865727c062810e29fa33b5c04bb05510e7da3ddf.tar.gz alacritty-865727c062810e29fa33b5c04bb05510e7da3ddf.zip |
Remove redundant copy when selecting font_keyv0.1.1
-rw-r--r-- | src/renderer/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index b006f566..560685af 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -827,12 +827,13 @@ impl<'a> RenderApi<'a> { for cell in cells { // Get font key for cell // FIXME this is super inefficient. - let mut font_key = glyph_cache.font_key; - if cell.flags.contains(cell::Flags::BOLD) { - font_key = glyph_cache.bold_key; + let font_key = if cell.flags.contains(cell::Flags::BOLD) { + glyph_cache.bold_key } else if cell.flags.contains(cell::Flags::ITALIC) { - font_key = glyph_cache.italic_key; - } + glyph_cache.italic_key + } else { + glyph_cache.font_key + }; let glyph_key = GlyphKey { font_key, |