[set] Adjust hb_set_copy()

This commit is contained in:
Behdad Esfahbod 2023-01-16 12:08:11 -07:00
parent b7f1c30c20
commit ca1de29e0a
1 changed files with 4 additions and 2 deletions

View File

@ -174,7 +174,7 @@ hb_set_allocation_successful (const hb_set_t *set)
* *
* Allocate a copy of @set. * Allocate a copy of @set.
* *
* Return value: Newly-allocated set. * Return value: (transfer full): Newly-allocated set.
* *
* Since: 2.8.2 * Since: 2.8.2
**/ **/
@ -182,7 +182,9 @@ hb_set_t *
hb_set_copy (const hb_set_t *set) hb_set_copy (const hb_set_t *set)
{ {
hb_set_t *copy = hb_set_create (); 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); copy->set (*set);
return copy; return copy;
} }