From f01ebe97b294444704c06c0501afddf999faddbe Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 5 Jun 2023 21:38:37 -0600 Subject: [PATCH] [vector] Minor write more idiomatic --- src/hb-vector.hh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index ced558ec0..ba135ef6f 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -295,11 +295,8 @@ struct hb_vector_t void grow_vector (unsigned size) { - while (length < size) - { - length++; - new (std::addressof (arrayZ[length - 1])) Type (); - } + for (; length < size; length++) + new (std::addressof (arrayZ[length])) Type (); } template