vold: Pass std::string by const reference

In a couple places, we change to pass a std::string argument
instead of by copy.

Test: TreeHugger
Change-Id: Ib179299a2322fcbab4e6d192051218823ad66a36
This commit is contained in:
Greg Kaiser 2018-12-18 11:10:31 -08:00
parent ef9abab5ee
commit 8ae16db72a
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@ namespace vold {
// If only "secret" is nonempty, it is used to decrypt in a non-Keymaster process.
class KeyAuthentication {
public:
KeyAuthentication(std::string t, std::string s) : token{t}, secret{s} {};
KeyAuthentication(const std::string& t, const std::string& s) : token{t}, secret{s} {};
bool usesKeymaster() const { return !token.empty() || secret.empty(); };

View file

@ -84,7 +84,7 @@ namespace vold {
// Note: It is possible to orphan a key if it is removed before deleting
// Update this once keymaster APIs change, and we have a proper commit.
static void commit_key(std::string dir) {
static void commit_key(const std::string& dir) {
while (!android::base::WaitForProperty("vold.checkpoint_committed", "1")) {
LOG(ERROR) << "Wait for boot timed out";
}