[name] Pre-allocate array
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 16 Oct 2018 06:28:49 +0000 (23:28 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Sat, 27 Oct 2018 04:22:26 +0000 (21:22 -0700)
src/hb-ot-name-table.hh

index 3d7b731..14ac4ef 100644 (file)
@@ -170,6 +170,7 @@ struct name
                                                                        this->table->count);
 
       this->names.init ();
+      this->names.alloc (all_names.len);
 
       for (uint16_t i = 0; i < all_names.len; i++)
       {