ICU-8175 Added note to clarify that j-1 is safe.

X-SVN-Rev: 29546
This commit is contained in:
Mark Davis 2011-03-04 23:56:24 +00:00
parent 8f2a1ed97c
commit b55bbd25a9

View File

@ -275,6 +275,7 @@ public class CharSequences {
if (cp >= 0xDC00 && cp <= 0xDFFF && i != 0 ) { // hand-code for speed
char last = (char) result[j-1];
if (last >= 0xD800 && last <= 0xDBFF) {
// Note: j-1 is safe, because j can only be zero if i is zero. But i!=0 in this block.
result[j-1] = Character.toCodePoint(last, cp);
continue;
}