]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcmatch.c
Reduce number of allocations during FcSortWalk().
[fontconfig.git] / src / fcmatch.c
index b3ee5c12c66e1ef16feb7917071304fd179f40a4..77b49cf181a2b41b004e463c4aea8a77c3ca0b38 100644 (file)
@@ -601,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);