[vte] font: pangocairo: Remove redundant code
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] font: pangocairo: Remove redundant code
- Date: Wed, 12 May 2021 20:32:10 +0000 (UTC)
commit c842a88dbf4b7defa6849f821b0c12bd8eb78883
Author: Debarshi Ray <debarshir gnome org>
Date: Wed May 12 22:31:55 2021 +0200
font: pangocairo: Remove redundant code
The max_height variable is initialized as 1, and then iteratively
updated to track the maximum height of all the characters from U+0021
to U+007E. The final value is assined to m_height. Hence m_height can
never be zero.
In the case of m_ascent, the contents of m_layout don't change between
the two places where it's assigned. Therefore, the second assignment is
redundant.
Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/355
src/fonts-pangocairo.cc | 7 -------
1 file changed, 7 deletions(-)
---
diff --git a/src/fonts-pangocairo.cc b/src/fonts-pangocairo.cc
index e77981b5..3fa24f64 100644
--- a/src/fonts-pangocairo.cc
+++ b/src/fonts-pangocairo.cc
@@ -201,13 +201,6 @@ FontInfo::measure_font()
/* Now that we shaped the entire ASCII character string, cache glyph
* info for them */
cache_ascii();
-
- if (m_height == 0) {
- m_height = PANGO_PIXELS_CEIL (logical.height);
- }
- if (m_ascent == 0) {
- m_ascent = PANGO_PIXELS_CEIL(pango_layout_get_baseline(m_layout.get()));
- }
}
FontInfo::FontInfo(vte::glib::RefPtr<PangoContext> context)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]