Replace string copies with const-ref

Change-Id: Ie3ea65cc81aa8b9a92a7718ca2003440a3189a4b
Test: Treehugger
This commit is contained in:
Seth Moore 2023-12-11 10:31:15 -08:00
parent 64930a6379
commit 121fedaa46
2 changed files with 5 additions and 4 deletions

View file

@ -17,6 +17,7 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <string>
#include <vector> #include <vector>
#include "aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.h" #include "aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.h"
@ -129,8 +130,8 @@ struct JsonOutput {
* "name": <string> * "name": <string>
* } * }
*/ */
JsonOutput jsonEncodeCsrWithBuild(const std::string instance_name, JsonOutput jsonEncodeCsrWithBuild(const std::string& instance_name, const cppbor::Array& csr,
const cppbor::Array& csr, const std::string serialno_prop); const std::string& serialno_prop);
/** /**
* Parses a DeviceInfo structure from the given CBOR data. The parsed data is then validated to * Parses a DeviceInfo structure from the given CBOR data. The parsed data is then validated to

View file

@ -337,8 +337,8 @@ ErrMsgOr<std::vector<BccEntryData>> validateBcc(const cppbor::Array* bcc,
return result; return result;
} }
JsonOutput jsonEncodeCsrWithBuild(const std::string instance_name, const cppbor::Array& csr, JsonOutput jsonEncodeCsrWithBuild(const std::string& instance_name, const cppbor::Array& csr,
const std::string serialno_prop) { const std::string& serialno_prop) {
const std::string kFingerprintProp = "ro.build.fingerprint"; const std::string kFingerprintProp = "ro.build.fingerprint";
if (!::android::base::WaitForPropertyCreation(kFingerprintProp)) { if (!::android::base::WaitForPropertyCreation(kFingerprintProp)) {