[vector] Add a missing fast-path

This commit is contained in:
Behdad Esfahbod 2025-02-25 18:53:04 -07:00
parent 41626401b0
commit 0cd98ebbf7

View file

@ -341,6 +341,15 @@ struct hb_vector_t
length = size;
}
template <typename T = Type,
hb_enable_if (hb_is_trivially_copyable (T))>
void
copy_array (hb_array_t<Type> other)
{
assert ((int) (length + other.length) <= allocated);
hb_memcpy ((void *) (arrayZ + length), (const void *) other.arrayZ, other.length * item_size);
length += other.length;
}
template <typename T = Type,
hb_enable_if (hb_is_trivially_copyable (T))>
void