summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-29 00:11:51 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-29 15:05:08 -0400
commitdde9a87aae0a83640341a7729e7440a206b56239 (patch)
treea83845f550358e74e888fef61221adc7ada69248
parent9ff4bdb34201b24ee6c4c8a7e7a65db95cf1b75e (diff)
downloadpango-dde9a87aae0a83640341a7729e7440a206b56239.tar.gz
Speed up ignorable check
No need to walk to the end if we are done.
-rw-r--r--pango/pango-impl-utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/pango/pango-impl-utils.h b/pango/pango-impl-utils.h
index d2420321..bbeca994 100644
--- a/pango/pango-impl-utils.h
+++ b/pango/pango-impl-utils.h
@@ -163,6 +163,9 @@ pango_get_ignorable (gunichar ch)
for (i = 0; i < G_N_ELEMENTS (ignorables); i++)
{
+ if (ch < ignorables[i].ch)
+ return NULL;
+
if (ch == ignorables[i].ch)
return ignorables[i].nick;
}