diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2005-11-22 02:17:37 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2005-11-22 02:17:37 +0000 |
commit | a319318a43a3b85d349d22ba8a0a1e1cbda61ac9 (patch) | |
tree | feaeef6ad7cd596de88c4081d929c820f1591c25 /pango/pango-script.c | |
parent | 818bbdab5f6bece7e96e66d4bc0c4a078e593805 (diff) | |
download | pango-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.c | 5 |
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; } |