Remove a couple of unnecessary static variables.
authorBehdad Esfahbod <behdad@gnome.org>
Mon, 18 Sep 2006 20:56:45 +0000 (20:56 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Mon, 18 Sep 2006 20:56:45 +0000 (20:56 +0000)
2006-09-18  Behdad Esfahbod  <behdad@gnome.org>

        * pango/pangoft2-render.c (pango_ft2_font_render_glyph): Remove a
        couple of unnecessary static variables.

ChangeLog
pango/pangoft2-render.c

index ed1a93f..f78e26e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-09-18  Behdad Esfahbod  <behdad@gnome.org>
 
+       * pango/pangoft2-render.c (pango_ft2_font_render_glyph): Remove a
+       couple of unnecessary static variables.
+
+2006-09-18  Behdad Esfahbod  <behdad@gnome.org>
+
        Bug 356194 – more pango_get_log_attrs problems
 
        * pango/break.c (tailor_break): New function.  Simply calls the
index 30763d7..473235f 100644 (file)
@@ -161,7 +161,7 @@ pango_ft2_font_render_glyph (PangoFont *font,
 
   if (glyph_index & PANGO_GLYPH_UNKNOWN_FLAG)
     {
-      static PangoFT2RenderedGlyph *box;
+      PangoFT2RenderedGlyph *box;
       PangoFontMetrics *metrics;
 
       if (!font)
@@ -171,9 +171,6 @@ pango_ft2_font_render_glyph (PangoFont *font,
       if (!metrics)
        goto generic_box;
 
-      /* this box gets cached, so don't bother with static'ing it.
-       */
-
       box = pango_ft2_font_render_box_glyph (PANGO_PIXELS (metrics->approximate_char_width),
                                             PANGO_PIXELS (metrics->ascent + metrics->descent),
                                             PANGO_PIXELS (metrics->ascent));
@@ -207,17 +204,10 @@ pango_ft2_font_render_glyph (PangoFont *font,
     }
   else
     {
-      static PangoFT2RenderedGlyph *box = NULL;
-
-    generic_box:
-      if (!box)
-        {
-         box = pango_ft2_font_render_box_glyph (PANGO_UNKNOWN_GLYPH_WIDTH,
-                                                PANGO_UNKNOWN_GLYPH_HEIGHT,
-                                                PANGO_UNKNOWN_GLYPH_HEIGHT);
-       }
-
-      return box;
+generic_box:
+      return  pango_ft2_font_render_box_glyph (PANGO_UNKNOWN_GLYPH_WIDTH,
+                                              PANGO_UNKNOWN_GLYPH_HEIGHT,
+                                              PANGO_UNKNOWN_GLYPH_HEIGHT);
     }
 }