]> git.wh0rd.org - fontconfig.git/blobdiff - src/fclist.c
Don't change the order of names unnecessarily (#20128)
[fontconfig.git] / src / fclist.c
index 61034089f181a98d731d95cb7c6a19985dddd1f5..d804c150386b5909c9853db9c2a88289c62df107 100644 (file)
@@ -350,7 +350,10 @@ FcGetDefaultObjectLangIndex (FcPattern *font, FcObject object)
            if (value.type == FcTypeString)
            {
                FcLangResult res = FcLangCompare (value.u.s, lang);
-               if (res == FcLangEqual || (res == FcLangDifferentCountry && idx < 0))
+               if (res == FcLangEqual)
+                   return i;
+
+               if (res == FcLangDifferentCountry && idx < 0)
                    idx = i;
            }
        }