From 8e9e94dba971e3b09d4a9853a8abcf68d5c6dc62 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 1 Dec 2022 19:40:21 -0700 Subject: [PATCH] Revert "[vector] Optimize grow_vector() for size" This reverts commit 1dd9396c7a4c24fe9d578551fab735bdd699e52a. Is faster indeed. 15% on SourceHanSans/10000 benchmark. --- src/hb-vector.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index 397571ae9..9b52f5ca9 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -254,6 +254,16 @@ struct hb_vector_t return new_array; } + template + void + grow_vector (unsigned size) + { + memset (arrayZ + length, 0, (size - length) * sizeof (*arrayZ)); + length = size; + } + template void grow_vector (unsigned size) {