Fix return-stack-address warning

Apply the same fix as https://r.android.com/2462896 to
keymaster/4.0/vts/performance/Benchmark.cpp

Test: presubmit
Bug: 271241374
Change-Id: Ib0d2a3a523491d0522f5b3dd031cdde46f88a165
This commit is contained in:
Yi Kong 2023-03-01 19:23:14 +09:00
parent 550964e884
commit 1a39569491

View file

@ -315,7 +315,7 @@ class KeymasterWrapper {
SecurityLevel getSecurityLevel() { return securityLevel_; }
const string& GenerateMessage(int size) {
const string GenerateMessage(int size) {
for (const string& message : message_cache_) {
if (message.size() == size) {
return message;
@ -323,7 +323,7 @@ class KeymasterWrapper {
}
string message = string(size, 'x');
message_cache_.push_back(message);
return std::move(message);
return message;
}
optional<BlockMode> getBlockMode(string transform) {
@ -714,4 +714,4 @@ int main(int argc, char** argv) {
return 1;
}
::benchmark::RunSpecifiedBenchmarks();
}
}