Various miscelaneous changes (#6496)

This commit is contained in:
Vitor K 2023-05-03 12:24:10 -03:00 committed by GitHub
parent 41f13456c0
commit 34de77d429
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 44 additions and 81 deletions

View file

@ -141,7 +141,8 @@ std::vector<std::string> GetFilesName(const std::string& filepath) {
jstring j_filepath = env->NewStringUTF(filepath.c_str());
auto j_object =
(jobjectArray)env->CallStaticObjectMethod(native_library, get_files_name, j_filepath);
jsize j_size = env->GetArrayLength(j_object);
const jsize j_size = env->GetArrayLength(j_object);
vector.reserve(j_size);
for (int i = 0; i < j_size; i++) {
auto string = (jstring)(env->GetObjectArrayElement(j_object, i));
vector.emplace_back(env->GetStringUTFChars(string, nullptr));