diff options
author | Greg Kaiser <gkaiser@google.com> | 2019-03-26 11:58:53 -0700 |
---|---|---|
committer | Greg Kaiser <gkaiser@google.com> | 2019-03-26 12:00:19 -0700 |
commit | e2125fdeb1f72f5599853f82fc7ed2be9d5ee015 (patch) | |
tree | 433739e6796aa6716c4f00088250b0430ad1e55d /adb/daemon/file_sync_service.cpp | |
parent | d2c4eb0daeb3a668e6127a9f932bf313a0840be1 (diff) |
adb: Avoid extra std::string copies
When a function argument takes a std::string, it's inefficient to
pass std::string::c_str(), since that creates an additional copy.
So we change these calling sites.
Test: TreeHugger
Change-Id: I1c0fde7275eb3ebd3baf05ec62581b0243655608
Diffstat (limited to 'adb/daemon/file_sync_service.cpp')
-rw-r--r-- | adb/daemon/file_sync_service.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/adb/daemon/file_sync_service.cpp b/adb/daemon/file_sync_service.cpp index 29bd798d4..e82a51f2b 100644 --- a/adb/daemon/file_sync_service.cpp +++ b/adb/daemon/file_sync_service.cpp @@ -422,7 +422,7 @@ static bool do_send(int s, const std::string& spec, std::vector<char>& buffer) { bool result; uint32_t timestamp; if (S_ISLNK(mode)) { - result = handle_send_link(s, path.c_str(), ×tamp, buffer); + result = handle_send_link(s, path, ×tamp, buffer); } else { // Copy user permission bits to "group" and "other" permissions. mode &= 0777; |