diff options
author | Googler <noreply@google.com> | 2017-05-30 19:29:16 +0200 |
---|---|---|
committer | László Csomor <laszlocsomor@google.com> | 2017-05-31 09:19:04 +0200 |
commit | ba8d95ffe6cd86b72c3cc43ade5b2fb296fa1579 (patch) | |
tree | 827a3ad72ab66113cac5b74b9cb8bc826bd7070e /src | |
parent | d894345ed88f8adce600b66a310b5210d0bcb59c (diff) |
Small optimization to avoid allocating strings in the bind mount loop.
PiperOrigin-RevId: 157479936
Diffstat (limited to 'src')
-rw-r--r-- | src/main/tools/linux-sandbox-pid1.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/tools/linux-sandbox-pid1.cc b/src/main/tools/linux-sandbox-pid1.cc index 8b5504f5da..2f08862fd8 100644 --- a/src/main/tools/linux-sandbox-pid1.cc +++ b/src/main/tools/linux-sandbox-pid1.cc @@ -175,8 +175,8 @@ static void MountFilesystems() { } for (size_t i = 0; i < opt.bind_mount_sources.size(); i++) { - std::string source = opt.bind_mount_sources.at(i); - std::string target = opt.bind_mount_targets.at(i); + const std::string& source = opt.bind_mount_sources.at(i); + const std::string& target = opt.bind_mount_targets.at(i); PRINT_DEBUG("bind mount: %s -> %s", source.c_str(), target.c_str()); if (mount(source.c_str(), target.c_str(), nullptr, MS_BIND, nullptr) < 0) { DIE("mount(%s, %s, nullptr, MS_BIND, nullptr)", source.c_str(), |