am af60e56b
: Revert "DO NOT MERGE Fix extraneous allocation and copying"
* commit 'af60e56b39582ea90ccd7601cd06350a50bf6500': Revert "DO NOT MERGE Fix extraneous allocation and copying"
This commit is contained in:
@ -63,7 +63,7 @@ static jintArray nLineBreakOpportunities(JNIEnv* env, jclass, jstring javaLocale
|
||||
jcharArray inputText, jint length,
|
||||
jintArray recycle) {
|
||||
jintArray ret;
|
||||
std::vector<jint> breaks;
|
||||
std::vector<jint> breaks(16);
|
||||
|
||||
ScopedIcuLocale icuLocale(env, javaLocaleName);
|
||||
if (icuLocale.valid()) {
|
||||
@ -84,7 +84,7 @@ static jintArray nLineBreakOpportunities(JNIEnv* env, jclass, jstring javaLocale
|
||||
|
||||
breaks.push_back(-1); // sentinel terminal value
|
||||
|
||||
if (recycle != NULL && static_cast<size_t>(env->GetArrayLength(recycle)) >= breaks.size()) {
|
||||
if (recycle != NULL && env->GetArrayLength(recycle) >= breaks.size()) {
|
||||
ret = recycle;
|
||||
} else {
|
||||
ret = env->NewIntArray(breaks.size());
|
||||
|
Reference in New Issue
Block a user