Commit c59c5e9a by Tom Tromey Committed by Tom Tromey

* java/lang/natCharacter.cc (isLowerCase): Use a binary search.

From-SVN: r26829
parent a06fcbd4
1999-05-07 Tom Tromey <tromey@cygnus.com> 1999-05-07 Tom Tromey <tromey@cygnus.com>
* java/lang/natCharacter.cc (isLowerCase): Use a binary search.
* libtool-version: New file. * libtool-version: New file.
* Makefile.in: Rebuilt. * Makefile.in: Rebuilt.
* Makefile.am (libgcj_la_LDFLAGS): Use -version-info, not * Makefile.am (libgcj_la_LDFLAGS): Use -version-info, not
......
...@@ -152,12 +152,27 @@ java::lang::Character::isLowerCase (jchar ch) ...@@ -152,12 +152,27 @@ java::lang::Character::isLowerCase (jchar ch)
if (table_search (lower_case_table, asize (lower_case_table), ch) != -1) if (table_search (lower_case_table, asize (lower_case_table), ch) != -1)
return true; return true;
// FIXME: use a binary search. int low, high, i, old;
for (unsigned int i = 0; i < asize (lower_anomalous_table); ++i)
low = 0;
high = asize (lower_anomalous_table);
i = high / 2;
while (true)
{ {
if (lower_anomalous_table[i] == ch) if (ch < lower_anomalous_table[i])
high = i;
else if (ch > lower_anomalous_table[i])
low = i;
else
return true; return true;
old = i;
i = (high + low) / 2;
if (i == old)
break;
} }
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment