freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] * src/cff/cffload.c (cff_encoding_load)


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/cff/cffload.c (cff_encoding_load): Optimize array zeroing.
Date: Sun, 26 Feb 2023 03:18:23 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 6423ddb8
    by Alexei Podtelezhnikov at 2023-02-25T21:54:21-05:00
    * src/cff/cffload.c (cff_encoding_load): Optimize array zeroing.
    
    This is unnecessary for predefined standard and expert encodings.
    Even for custom encodings the arrays might be already zeroed when
    CFF_FontRec is created but we keep it just in case.
    

1 changed file:

Changes:

  • src/cff/cffload.c
    ... ... @@ -1650,13 +1650,6 @@
    1650 1650
           goto Exit;
    
    1651 1651
         }
    
    1652 1652
     
    
    1653
    -    /* Zero out the code to gid/sid mappings. */
    
    1654
    -    for ( j = 0; j < 256; j++ )
    
    1655
    -    {
    
    1656
    -      encoding->sids [j] = 0;
    
    1657
    -      encoding->codes[j] = 0;
    
    1658
    -    }
    
    1659
    -
    
    1660 1653
         /* Note: The encoding table in a CFF font is indexed by glyph index;  */
    
    1661 1654
         /* the first encoded glyph index is 1.  Hence, we read the character  */
    
    1662 1655
         /* code (`glyph_code') at index j and make the assignment:            */
    
    ... ... @@ -1671,6 +1664,10 @@
    1671 1664
     
    
    1672 1665
         if ( offset > 1 )
    
    1673 1666
         {
    
    1667
    +      /* Zero out the code to gid/sid mappings. */
    
    1668
    +      FT_ARRAY_ZERO( encoding->sids,  256 );
    
    1669
    +      FT_ARRAY_ZERO( encoding->codes, 256 );
    
    1670
    +
    
    1674 1671
           encoding->offset = base_offset + offset;
    
    1675 1672
     
    
    1676 1673
           /* we need to parse the table to determine its size */
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]