summaryrefslogtreecommitdiff
path: root/pango/pango-script.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2005-11-22 02:17:37 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-11-22 02:17:37 +0000
commita319318a43a3b85d349d22ba8a0a1e1cbda61ac9 (patch)
treefeaeef6ad7cd596de88c4081d929c820f1591c25 /pango/pango-script.c
parent818bbdab5f6bece7e96e66d4bc0c4a078e593805 (diff)
downloadpango-a319318a43a3b85d349d22ba8a0a1e1cbda61ac9.tar.gz
Only update static mid on a match.
2005-11-21 Behdad Esfahbod <behdad@gnome.org> * pango/pango-script.c (pango_script_for_unichar_bsearch): Only update static mid on a match.
Diffstat (limited to 'pango/pango-script.c')
-rw-r--r--pango/pango-script.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pango/pango-script.c b/pango/pango-script.c
index 85ad543d..00bf4347 100644
--- a/pango/pango-script.c
+++ b/pango/pango-script.c
@@ -89,7 +89,8 @@ pango_script_for_unichar_bsearch (gunichar ch)
{
int lower = 0;
int upper = G_N_ELEMENTS (pango_script_table) - 1;
- static int mid = PANGO_SCRIPT_TABLE_MIDPOINT;
+ static int saved_mid = PANGO_SCRIPT_TABLE_MIDPOINT;
+ int mid = saved_mid;
do
@@ -99,7 +100,7 @@ pango_script_for_unichar_bsearch (gunichar ch)
else if (ch >= pango_script_table[mid].start + pango_script_table[mid].chars)
lower = mid + 1;
else
- return pango_script_table[mid].script;
+ return pango_script_table[saved_mid = mid].script;
mid = (lower + upper) / 2;
}