From 1b0cb23adcdf0c2b136b41d805b157f0c6d75ad4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 18 Aug 2020 15:02:21 -0400 Subject: [PATCH] Add a shortcut for FcQualAny matching When checking whether a test matches a pattern, we cut the loop short for FcQualAll when we see the first non-matching value, but for FcQualAny we were always walking the full list. This patch cuts the loop short for FcQualAny when we see the first matching value. --- src/fccfg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fccfg.c b/src/fccfg.c index 74e8746..cb4d3e0 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -1550,6 +1550,8 @@ FcConfigMatchValueList (FcPattern *p, { if (!ret) ret = v; + if (t->qual != FcQualAll) + break; } else {