[vector] Adjust for HB_OPTIMIZE_SIZE

This commit is contained in:
Behdad Esfahbod 2022-11-25 13:28:53 -07:00
parent 1d474194f0
commit 7b197446ac
1 changed files with 4 additions and 1 deletions

View File

@ -267,10 +267,13 @@ struct hb_vector_t
copy_vector (const hb_vector_t &other) copy_vector (const hb_vector_t &other)
{ {
length = other.length; length = other.length;
#ifndef HB_OPTIMIZE_SIZE
/* This runs faster because of alignment. */ /* This runs faster because of alignment. */
for (unsigned i = 0; i < length; i++) for (unsigned i = 0; i < length; i++)
arrayZ[i] = other.arrayZ[i]; arrayZ[i] = other.arrayZ[i];
//hb_memcpy ((void *) arrayZ, (const void *) other.arrayZ, length * item_size); #else
hb_memcpy ((void *) arrayZ, (const void *) other.arrayZ, length * item_size);
#endif
} }
template <typename T = Type, template <typename T = Type,
hb_enable_if (!hb_is_trivially_copyable (T) && hb_enable_if (!hb_is_trivially_copyable (T) &&