From ca1de29e0a85508b9938defd5e7a4b08e3134c7b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 16 Jan 2023 12:08:11 -0700 Subject: [PATCH] [set] Adjust hb_set_copy() --- src/hb-set.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-set.cc b/src/hb-set.cc index 4496120fe..aa2900de3 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -174,7 +174,7 @@ hb_set_allocation_successful (const hb_set_t *set) * * Allocate a copy of @set. * - * Return value: Newly-allocated set. + * Return value: (transfer full): Newly-allocated set. * * Since: 2.8.2 **/ @@ -182,7 +182,9 @@ hb_set_t * hb_set_copy (const hb_set_t *set) { hb_set_t *copy = hb_set_create (); - if (unlikely (!copy)) return nullptr; + if (unlikely (copy->in_error ())) + return hb_set_get_empty (); + copy->set (*set); return copy; }