]> git.wh0rd.org Git - fontconfig.git/commitdiff
List iteration not needed in FcConfigValues, since it's building up the
authorPatrick Lam <plam@MIT.EDU>
Fri, 18 Nov 2005 04:21:10 +0000 (04:21 +0000)
committerPatrick Lam <plam@MIT.EDU>
Fri, 18 Nov 2005 04:21:10 +0000 (04:21 +0000)
    list itself; we can just strip FcVoid elements during construction.
reviewed by: plam

ChangeLog
src/fccfg.c

index 7216ca184b03fa27fb72d1c5ee4226c1a73b8dcc..f93693b92577586c60c9f80547caa208459a919a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-10-25  Jinghua Luo  <sunmoon1997@gmail.com>
+       reviewed by: plam
+
+       * src/fccfg.c (FcConfigValues):
+
+       List iteration not needed in FcConfigValues, since it's building
+       up the list itself; we can just strip FcVoid elements during
+       construction.
+
 2005-11-17  Patrick Lam  <plam@mit.edu>
        * src/fccfg.c (FcConfigValues):
 
index 3c311f94437765dfa7db9914b94da93b6a0f27e3..4543553cef8488d999499a09277196685cf71ae9 100644 (file)
@@ -1091,7 +1091,6 @@ static FcValueList *
 FcConfigValues (FcPattern *p, FcExpr *e, FcValueBinding binding)
 {
     FcValueList        *l;
-    FcValueListPtr lp;
     
     if (!e)
        return 0;
@@ -1110,19 +1109,15 @@ FcConfigValues (FcPattern *p, FcExpr *e, FcValueBinding binding)
        l->next  = FcValueListPtrCreateDynamic(0);
     }
     l->binding = binding;
-    lp = FcValueListPtrCreateDynamic(l);
-    while (FcValueListPtrU(lp) && FcValueListPtrU(lp)->value.type == FcTypeVoid)
+    if (l->value.type == FcTypeVoid)
     {
-       FcValueListPtr  next = FcValueListPtrU(lp)->next;
+       FcValueList  *next = FcValueListPtrU(l->next);
 
-       if (lp.bank == FC_BANK_DYNAMIC)
-       {
-           FcMemFree (FC_MEM_VALLIST, sizeof (FcValueList));
-           free (l);
-       }
-       lp = next;
-        l = FcValueListPtrU (lp);
+       FcMemFree (FC_MEM_VALLIST, sizeof (FcValueList));
+       free (l);
+       l = next;
     }
+
     return l;
 }