From 4db90f588ea319747c18f78986d47d7be57da1b3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 16 Dec 2023 21:54:46 -0700 Subject: [PATCH] [loca] Minor speedup --- Lib/fontTools/ttLib/tables/_l_o_c_a.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/_l_o_c_a.py b/Lib/fontTools/ttLib/tables/_l_o_c_a.py index 5884cef45..39c0c9e39 100644 --- a/Lib/fontTools/ttLib/tables/_l_o_c_a.py +++ b/Lib/fontTools/ttLib/tables/_l_o_c_a.py @@ -21,10 +21,7 @@ class table__l_o_c_a(DefaultTable.DefaultTable): if sys.byteorder != "big": locations.byteswap() if not longFormat: - l = array.array("I") - for i in range(len(locations)): - l.append(locations[i] * 2) - locations = l + locations = array.array("I", (2 * l for l in locations)) if len(locations) < (ttFont["maxp"].numGlyphs + 1): log.warning( "corrupt 'loca' table, or wrong numGlyphs in 'maxp': %d %d",