]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcmatch.c
Reduce number of allocations during FcSortWalk().
[fontconfig.git] / src / fcmatch.c
index 96587cbc310d41ac6aef92dc683ad5910f015dd5..77b49cf181a2b41b004e463c4aea8a77c3ca0b38 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $RCSId: xc/lib/fontconfig/src/fcmatch.c,v 1.20 2002/08/31 22:17:32 keithp Exp $
+ * fontconfig/src/fcmatch.c
  *
  * Copyright © 2000 Keith Packard
  *
@@ -226,17 +226,16 @@ static FcMatcher _FcMatchers [] = {
 #define MATCH_WIDTH_INDEX   10
     
     { FC_DECORATIVE_OBJECT,    FcCompareBool,          11, 11 },
-#define MATCH_DECORATIVE       11
-#define MATCH_DECORATIVE_INDEX 12
+#define MATCH_DECORATIVE       10
+#define MATCH_DECORATIVE_INDEX 11
 
     { FC_ANTIALIAS_OBJECT,     FcCompareBool,          12, 12 },
-    
 #define MATCH_ANTIALIAS                    11
 #define MATCH_ANTIALIAS_INDEX      12
     
     { FC_RASTERIZER_OBJECT,    FcCompareString,        13, 13 },
 #define MATCH_RASTERIZER           12
-#define MATCH_RASTERIZER_INDEX     12
+#define MATCH_RASTERIZER_INDEX     13
 
     { FC_OUTLINE_OBJECT,       FcCompareBool,          14, 14 },
 #define MATCH_OUTLINE              13
@@ -602,16 +601,9 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **cs, FcBool tri
            {
                 if (trim || build_cs)
                 {
-                    if (*cs)
-                    {
-                        ncs = FcCharSetUnion (ncs, *cs);
-                        if (!ncs)
-                            return FcFalse;
-                        FcCharSetDestroy (*cs);
-                    }
-                    else
-                        ncs = FcCharSetCopy (ncs);
-                    *cs = ncs;
+                   *cs = FcCharSetMerge (*cs, ncs);
+                   if (*cs == NULL)
+                       return FcFalse;
                 }
 
                FcPatternReference (node->pattern);
@@ -835,3 +827,6 @@ FcFontSort (FcConfig        *config,
        sets[nsets++] = config->fonts[FcSetApplication];
     return FcFontSetSort (config, sets, nsets, p, trim, csp, result);
 }
+#define __fcmatch__
+#include "fcaliastail.h"
+#undef __fcmatch__