]> git.wh0rd.org - fontconfig.git/commitdiff
Short circuit FcPatternEqual when both args point at the same pattern
authorKeith Packard <keithp@keithp.com>
Wed, 7 Aug 2002 01:45:59 +0000 (01:45 +0000)
committerKeith Packard <keithp@keithp.com>
Wed, 7 Aug 2002 01:45:59 +0000 (01:45 +0000)
src/fcpat.c

index 807b9fb1ed5187ee88d24e9fe8d3286023f29628..62d779babb1ab90726d1d5a8e712aa4802fbc310 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.10 2002/06/29 20:31:02 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.11 2002/07/06 23:47:44 keithp Exp $
  *
  * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
  *
@@ -338,6 +338,9 @@ FcPatternEqual (const FcPattern *pa, const FcPattern *pb)
 {
     int        i;
 
+    if (pa == pb)
+       return FcTrue;
+
     if (pa->num != pb->num)
        return FcFalse;
     for (i = 0; i < pa->num; i++)