From bcd59b5142d6c8bee71c252c8f44240542ab9dab Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 20 Jul 2022 15:57:09 -0600 Subject: [PATCH] [set/map] Remove init_shallow/fini_shallow() --- src/hb-map.hh | 18 ++++++------------ src/hb-set.hh | 6 ++---- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index d5bf81ae3..8302e3f8c 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -124,21 +124,20 @@ struct hb_hashmap_t hb_swap (a.prime, b.prime); hb_swap (a.items, b.items); } - void init_shallow () + void init () { + hb_object_init (this); + successful = true; population = occupancy = 0; mask = 0; prime = 0; items = nullptr; } - void init () - { - hb_object_init (this); - init_shallow (); - } - void fini_shallow () + void fini () { + hb_object_fini (this); + if (likely (items)) { unsigned size = mask + 1; for (unsigned i = 0; i < size; i++) @@ -148,11 +147,6 @@ struct hb_hashmap_t } population = occupancy = 0; } - void fini () - { - hb_object_fini (this); - fini_shallow (); - } void reset () { diff --git a/src/hb-set.hh b/src/hb-set.hh index 7eb5e19a2..5d5576cb9 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -59,17 +59,15 @@ struct hb_sparseset_t hb_copy (o, *this); } - void init_shallow () { s.init (); } void init () { hb_object_init (this); - init_shallow (); + s.init (); } - void fini_shallow () { s.fini (); } void fini () { hb_object_fini (this); - fini_shallow (); + s.fini (); } explicit operator bool () const { return !is_empty (); }