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
diff --git a/audio/aidl/default/EffectMain.cpp b/audio/aidl/default/EffectMain.cpp
index a300cfd..7a6141a 100644
--- a/audio/aidl/default/EffectMain.cpp
+++ b/audio/aidl/default/EffectMain.cpp
@@ -38,7 +38,7 @@
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 {
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 543efd1..c14d06e 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -391,7 +391,7 @@
Module::Configuration& Module::getConfig() {
if (!mConfig) {
- mConfig = std::move(initializeConfig());
+ mConfig = initializeConfig();
}
return *mConfig;
}