mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
b73674c009
Summary: C++ is full of footguns, in this case, the lockContents method either returns a const std::vector<TreeEntry>&, or an rlock RAII for a folly::Synchronized object. When assigning the return value of that method to an `auto` variable, a copy is made in both cases, which isn't exactly what is desired in the first case. Instead using the reference as-is is what we want. To achieve the right behavior, a `const auto&` needs to be used: it will either be a const reference in the first case, or a copy in the second case. During an `arc focus2` while the Buck parsing phase is ongoing, the copy shows up at the top of the profiler as one of the most expensive operation. This significantly reduce its cost. Reviewed By: chadaustin Differential Revision: D28591502 fbshipit-source-id: eac1e062ed94442c90ac549ec137d91b4cb42b9c |
||
---|---|---|
.. | ||
benchharness | ||
benchmarks | ||
cli | ||
cli_rs | ||
config | ||
docs | ||
fuse | ||
inodes | ||
journal | ||
model | ||
monitor | ||
nfs | ||
notifications | ||
prjfs | ||
py | ||
rocksdb | ||
scripts | ||
service | ||
sqlite | ||
store | ||
takeover | ||
telemetry | ||
testharness | ||
third-party | ||
utils | ||
CMakeLists.txt |