[pango/misc-speedups: 2/6] Speed up ignorable check




commit 90cde1b9e148806536f91935f8555e205846769c
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 29 00:11:51 2021 -0400

    Speed up ignorable check
    
    No need to walk to the end if we are done.

 pango/pango-impl-utils.h | 3 +++
 1 file changed, 3 insertions(+)
---
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;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]