[HarfBuzz] harfbuzz-ng: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu May 20 08:27:02 PDT 2010


 src/hb-font.cc |    2 +-
 src/hb-ft.cc   |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 750a2294553d252e28875b605fe61fd9d6696e0f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu May 20 16:23:27 2010 +0100

    get_table() is allowed to return NULL.  Use that to simplify code

diff --git a/src/hb-font.cc b/src/hb-font.cc
index 7b58330..93787c0 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -364,7 +364,7 @@ hb_face_get_table (hb_face_t *face,
 
   blob = face->get_table (tag, face->user_data);
 
-  return blob? blob : &_hb_blob_nil;
+  return likely (blob) ? blob : &_hb_blob_nil;
 }
 
 
diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index fdd87bc..1360733 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -153,11 +153,11 @@ _get_table  (hb_tag_t tag, void *user_data)
   FT_Error error;
 
   if (unlikely (tag == HB_TAG_NONE))
-    return hb_blob_create_empty ();
+    return NULL;
 
   error = FT_Load_Sfnt_Table (ft_face, tag, 0, NULL, &length);
   if (error)
-    return hb_blob_create_empty ();
+    return NULL;
 
   /* TODO Use FT_Memory? */
   buffer = (FT_Byte *) malloc (length);
@@ -166,7 +166,7 @@ _get_table  (hb_tag_t tag, void *user_data)
 
   error = FT_Load_Sfnt_Table (ft_face, tag, 0, buffer, &length);
   if (error)
-    return hb_blob_create_empty ();
+    return NULL;
 
   return hb_blob_create ((const char *) buffer, length,
 			 HB_MEMORY_MODE_WRITABLE,



More information about the HarfBuzz mailing list