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

Commit 4a96670e authored by Greg Kaiser's avatar Greg Kaiser
Browse files

internal_os_Zygote: Avoid string copy

Since PrepareDir() takes a const std::string&, we just want to
directly pass our std::string, instead of passing the result
of c_str(), which would require constructing a new std::string.

Test: TreeHugger
Change-Id: Ifecd7ce61f5cd744c1562600cfe9f69353e6d80e
parent aa85de17
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1471,8 +1471,7 @@ static void isolateJitProfile(JNIEnv* env, jobjectArray pkg_data_info_list,

  // Create profile directory for this user.
  std::string actualCurUserProfile = StringPrintf("%s/%d", kCurProfileDirPath, user_id);
  PrepareDir(actualCurUserProfile.c_str(), DEFAULT_DATA_DIR_PERMISSION, AID_ROOT, AID_ROOT,
      fail_fn);
  PrepareDir(actualCurUserProfile, DEFAULT_DATA_DIR_PERMISSION, AID_ROOT, AID_ROOT, fail_fn);

  for (int i = 0; i < size; i += 3) {
    jstring package_str = (jstring) (env->GetObjectArrayElement(pkg_data_info_list, i));