Revert "[vector] Optimize grow_vector() for size"
This reverts commit 1dd9396c7a
.
Is faster indeed.
15% on SourceHanSans/10000 benchmark.
This commit is contained in:
parent
2644540a74
commit
8e9e94dba9
|
@ -254,6 +254,16 @@ struct hb_vector_t
|
||||||
return new_array;
|
return new_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T = Type,
|
||||||
|
hb_enable_if (hb_is_trivially_constructible(T))>
|
||||||
|
void
|
||||||
|
grow_vector (unsigned size)
|
||||||
|
{
|
||||||
|
memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ));
|
||||||
|
length = size;
|
||||||
|
}
|
||||||
|
template <typename T = Type,
|
||||||
|
hb_enable_if (!hb_is_trivially_constructible(T))>
|
||||||
void
|
void
|
||||||
grow_vector (unsigned size)
|
grow_vector (unsigned size)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue