summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2023-02-25 11:02:21 -0500
committerAlexei Podtelezhnikov <apodtele@gmail.com>2023-02-25 11:02:21 -0500
commit74c498a383ed1162d37c18f74cceb6db38916f14 (patch)
tree5403db4221a6d80640f4a90a77d2d687050e3636
parent3f2ac7d890941b747794cbdbf9a08aa3ec667c3d (diff)
downloadfreetype2-74c498a383ed1162d37c18f74cceb6db38916f14.tar.gz
* src/type1/t1load.c (T1_Get_MM_Var): Optimize array zeroing.
-rw-r--r--src/type1/t1load.c9
1 files 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;