Move code around
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 5 May 2011 18:47:53 +0000 (14:47 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 5 May 2011 18:47:53 +0000 (14:47 -0400)
src/hb-object-private.hh

index ffe87b4..1add2e7 100644 (file)
@@ -106,20 +106,20 @@ typedef struct {
 
 /* XXX make this thread-safe, somehow! */
 
-struct hb_user_data_t {
-  hb_user_data_key_t *key;
-  void *data;
-  hb_destroy_func_t destroy;
+struct hb_user_data_array_t {
 
-  inline bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; }
-  inline bool operator == (hb_user_data_t &other) const { return key == other.key; }
+  struct hb_user_data_item_t {
+    hb_user_data_key_t *key;
+    void *data;
+    hb_destroy_func_t destroy;
 
-  void finish (void) { if (destroy) destroy (data); }
-};
+    inline bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; }
+    inline bool operator == (hb_user_data_item_t &other) const { return key == other.key; }
 
-struct hb_user_data_array_t {
+    void finish (void) { if (destroy) destroy (data); }
+  };
 
-  hb_set_t<hb_user_data_t> items;
+  hb_set_t<hb_user_data_item_t> items;
 
   inline bool set (hb_user_data_key_t *key,
                   void *              data,
@@ -131,13 +131,13 @@ struct hb_user_data_array_t {
       items.remove (key);
       return true;
     }
-    hb_user_data_t user_data = {key, data, destroy};
-    return items.insert (user_data);
+    hb_user_data_item_t item = {key, data, destroy};
+    return items.insert (item);
   }
 
   inline void *get (hb_user_data_key_t *key) {
-    hb_user_data_t *user_data = items.get (key);
-    return user_data ? user_data->data : NULL;
+    hb_user_data_item_t *item = items.get (key);
+    return item ? item->data : NULL;
   }
 
   void finish (void) { items.finish (); }