From af274507c4f4c5a582543affa71d81a87d6d9151 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 10 Feb 2018 13:25:49 -0600 Subject: [PATCH] Minor --- src/hb-private.hh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/hb-private.hh b/src/hb-private.hh index 4d526d9d3..4a8d950d7 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -425,14 +425,13 @@ struct hb_prealloced_array_t return &array[len - 1]; } - // Alloc enouch for size if size < allocated. Don't adjust len. + /* Allocate for size but don't adjust len. */ inline bool alloc(unsigned int size) { - if (likely (size <= allocated)) - { + if (likely (size <= allocated)) return true; - } - /* Need to reallocate */ + + /* Reallocate */ unsigned int new_allocated = allocated; while (size >= new_allocated) @@ -456,16 +455,14 @@ struct hb_prealloced_array_t array = new_array; allocated = new_allocated; - + return true; } inline bool resize (unsigned int size) { - if (!alloc(size)) - { + if (!alloc (size)) return false; - } len = size; return true;