audio: Remove unnecessary std::move

Moving a temporary object prevents copy elision, and could reduce
performance.

This fixes -Wpessimizing-move compiler warning.

Test: presubmit
Bug: 154270751
Change-Id: Idb1a4abf4da9eb6dbe1e9a8fd66461d60985c8e1
This commit is contained in:
Yi Kong
2024-08-14 01:52:04 +08:00
parent fc8d55a0bf
commit e62f97fb5b
3 changed files with 3 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ static inline std::string config_file_path() {
candidatePath.append(apexName).append("/etc/").append(kDefaultConfigName);
LOG(DEBUG) << __func__ << " effect lib path " << candidatePath;
if (access(candidatePath.c_str(), R_OK) == 0) {
return std::move(candidatePath);
return candidatePath;
}
}
} else {

View File

@@ -391,7 +391,7 @@ std::vector<AudioRoute*> Module::getAudioRoutesForAudioPortImpl(int32_t portId)
Module::Configuration& Module::getConfig() {
if (!mConfig) {
mConfig = std::move(initializeConfig());
mConfig = initializeConfig();
}
return *mConfig;
}

View File

@@ -1025,7 +1025,7 @@ status_t HidlUtils::audioTagsToHal(const hidl_vec<AudioTag>& tags, char* halTags
result = BAD_VALUE;
}
}
std::string fullHalTags{std::move(halTagsBuffer.str())};
std::string fullHalTags{halTagsBuffer.str()};
strncpy(halTags, fullHalTags.c_str(), AUDIO_ATTRIBUTES_TAGS_MAX_SIZE);
CONVERT_CHECKED(fullHalTags.length() <= AUDIO_ATTRIBUTES_TAGS_MAX_SIZE ? NO_ERROR : BAD_VALUE,
result);