Shrink code
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 5 May 2011 19:28:37 +0000 (15:28 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 5 May 2011 19:28:37 +0000 (15:28 -0400)
src/hb-common.cc
src/hb-object-private.hh

index 368789a..68c8711 100644 (file)
@@ -29,6 +29,7 @@
 #include "hb-private.hh"
 
 #include "hb-mutex-private.hh"
+#include "hb-object-private.hh"
 
 HB_BEGIN_DECLS
 
@@ -261,4 +262,29 @@ hb_script_get_horizontal_direction (hb_script_t script)
 }
 
 
+/* hb_user_data_array_t */
+
+bool
+hb_user_data_array_t::set (hb_user_data_key_t *key,
+                          void *              data,
+                          hb_destroy_func_t   destroy)
+{
+  if (!key)
+    return false;
+  if (!data && !destroy) {
+    items.remove (key);
+    return true;
+  }
+  hb_user_data_item_t item = {key, data, destroy};
+  return !!items.insert (item);
+}
+
+void *
+hb_user_data_array_t::get (hb_user_data_key_t *key)
+{
+  hb_user_data_item_t *item = items.find (key);
+  return item ? item->data : NULL;
+}
+
+
 HB_END_DECLS
index dc7dba9..d3207b0 100644 (file)
@@ -121,24 +121,11 @@ struct hb_user_data_array_t {
 
   hb_set_t<hb_user_data_item_t> items;
 
-  inline bool set (hb_user_data_key_t *key,
-                  void *              data,
-                  hb_destroy_func_t   destroy)
-  {
-    if (!key)
-      return false;
-    if (!data && !destroy) {
-      items.remove (key);
-      return true;
-    }
-    hb_user_data_item_t item = {key, data, destroy};
-    return !!items.insert (item);
-  }
+  HB_INTERNAL bool set (hb_user_data_key_t *key,
+                       void *              data,
+                       hb_destroy_func_t   destroy);
 
-  inline void *get (hb_user_data_key_t *key) {
-    hb_user_data_item_t *item = items.find (key);
-    return item ? item->data : NULL;
-  }
+  HB_INTERNAL void *get (hb_user_data_key_t *key);
 
   void finish (void) { items.finish (); }
 };