From 74c498a383ed1162d37c18f74cceb6db38916f14 Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Sat, 25 Feb 2023 11:02:21 -0500 Subject: [PATCH] * src/type1/t1load.c (T1_Get_MM_Var): Optimize array zeroing. --- src/type1/t1load.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 3ec9ffa16..371edf4c1 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -320,9 +320,9 @@ sizeof ( FT_UShort ) ); axis_size = mmaster.num_axis * sizeof ( FT_Var_Axis ); - if ( FT_ALLOC( mmvar, mmvar_size + - axis_flags_size + - axis_size ) ) + if ( FT_QALLOC( mmvar, mmvar_size + + axis_flags_size + + axis_size ) ) goto Exit; mmvar->num_axis = mmaster.num_axis; @@ -333,8 +333,7 @@ /* to make `FT_Get_Var_Axis_Flags' work: the function expects that the */ /* values directly follow the data of `FT_MM_Var' */ axis_flags = (FT_UShort*)( (char*)mmvar + mmvar_size ); - for ( i = 0; i < mmaster.num_axis; i++ ) - axis_flags[i] = 0; + FT_ARRAY_ZERO( axis_flags, mmaster.num_axis ); mmvar->axis = (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size ); mmvar->namedstyle = NULL;