[post] Pre-alloc name index array
This commit is contained in:
parent
36bef5dccf
commit
7389efd8e0
|
@ -134,6 +134,7 @@ struct post
|
||||||
pool = &StructAfter<uint8_t> (v2.glyphNameIndex);
|
pool = &StructAfter<uint8_t> (v2.glyphNameIndex);
|
||||||
|
|
||||||
const uint8_t *end = (const uint8_t *) (const void *) table + table_length;
|
const uint8_t *end = (const uint8_t *) (const void *) table + table_length;
|
||||||
|
index_to_offset.alloc (hb_min (face->get_num_glyphs (), table_length / 8));
|
||||||
for (const uint8_t *data = pool;
|
for (const uint8_t *data = pool;
|
||||||
index_to_offset.length < 65535 && data < end && data + *data < end;
|
index_to_offset.length < 65535 && data < end && data + *data < end;
|
||||||
data += 1 + *data)
|
data += 1 + *data)
|
||||||
|
|
Loading…
Reference in New Issue