Short circuit FcPatternEqual when both args point at the same pattern

This commit is contained in:
Keith Packard 2002-08-07 01:45:59 +00:00
parent 0e344dec0b
commit bd724c8596
1 changed files with 4 additions and 1 deletions

View 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. * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
* *
@ -338,6 +338,9 @@ FcPatternEqual (const FcPattern *pa, const FcPattern *pb)
{ {
int i; int i;
if (pa == pb)
return FcTrue;
if (pa->num != pb->num) if (pa->num != pb->num)
return FcFalse; return FcFalse;
for (i = 0; i < pa->num; i++) for (i = 0; i < pa->num; i++)