[map] Adjust hb_map_copy()
This commit is contained in:
parent
e0883d60e4
commit
b7f1c30c20
|
@ -174,7 +174,7 @@ hb_map_allocation_successful (const hb_map_t *map)
|
|||
*
|
||||
* Allocate a copy of @map.
|
||||
*
|
||||
* Return value: Newly-allocated map.
|
||||
* Return value: (transfer full): Newly-allocated map.
|
||||
*
|
||||
* Since: 4.4.0
|
||||
**/
|
||||
|
@ -182,9 +182,10 @@ hb_map_t *
|
|||
hb_map_copy (const hb_map_t *map)
|
||||
{
|
||||
hb_map_t *copy = hb_map_create ();
|
||||
if (unlikely (!copy)) return nullptr;
|
||||
copy->resize (map->population);
|
||||
hb_copy (*map, *copy);
|
||||
if (unlikely (copy->in_error ()))
|
||||
return hb_map_get_empty ();
|
||||
|
||||
*copy = *map;
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue