Commit 5d5a6379 authored by Marco Magdy's avatar Marco Magdy

Avoid unnecessary conversion and temporaries

Passing the result of c_str() to a function that takes std::string as argument no. 2 is slow and redundant.
parent 5eadf662
......@@ -28,8 +28,8 @@ public:
return jniUTF8FromString(jniEnv, j);
}
static jstring toJava(JNIEnv* jniEnv, std::string c) {
return jniStringFromUTF8(jniEnv, c.c_str());
static jstring toJava(JNIEnv* jniEnv, const std::string & c) {
return jniStringFromUTF8(jniEnv, c);
}
};
......
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