Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ab1900a authored by Alan Lau's avatar Alan Lau
Browse files

Revert "Revert "DO NOT MERGE Fix extraneous allocation and copying""

This reverts commit af60e56b.

Change-Id: I1aa698608773b9e540457831e11218f371c71268
parent af60e56b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static jintArray nLineBreakOpportunities(JNIEnv* env, jclass, jstring javaLocale
                                        jcharArray inputText, jint length,
                                        jintArray recycle) {
    jintArray ret;
    std::vector<jint> breaks(16);
    std::vector<jint> breaks;

    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 && env->GetArrayLength(recycle) >= breaks.size()) {
    if (recycle != NULL && static_cast<size_t>(env->GetArrayLength(recycle)) >= breaks.size()) {
        ret = recycle;
    } else {
        ret = env->NewIntArray(breaks.size());