mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 14:58:03 +03:00
CodeMod: future-then-continuation-lvalue-ref
Summary: CodeMod: `future-then-continuation-lvalue-ref`. ``` buck run mode/opt foundation/clangr:clangr_coordinator -- run foundation/clang/codemods:future-then-continuation-lvalue-ref --dev -p 7 --num-workers=200 ``` There is no need to support continuations taking non-const lvalue-ref params; callers can get exactly the same semantics with non-const rvalue-ref params instead. Thsi codemod preserves semantics. Many of these cases could do just as well taking by value, but this codemod preserves semantics. Reviewed By: Orvid Differential Revision: D8166008 fbshipit-source-id: 84b635cccce24b6485ffb5b24b98f10422b9a517
This commit is contained in:
parent
deee232d74
commit
96af55472f
@ -115,7 +115,7 @@ Future<Unit> TreeDiffer::diffCommits(Hash hash1, Hash hash2) {
|
||||
return collect(future1, future2)
|
||||
.then([this](std::tuple<
|
||||
std::shared_ptr<const Tree>,
|
||||
std::shared_ptr<const Tree>>& tup) {
|
||||
std::shared_ptr<const Tree>>&& tup) {
|
||||
auto tree1 = std::get<0>(tup);
|
||||
auto tree2 = std::get<1>(tup);
|
||||
return diffTrees(RelativePathPiece{}, *tree1, *tree2);
|
||||
@ -135,7 +135,7 @@ TreeDiffer::diffTrees(RelativePathPiece path, Hash hash1, Hash hash2) {
|
||||
return folly::collect(treeFuture1, treeFuture2)
|
||||
.then([this, path = path.copy()](std::tuple<
|
||||
std::shared_ptr<const Tree>,
|
||||
std::shared_ptr<const Tree>>& tup) {
|
||||
std::shared_ptr<const Tree>>&& tup) {
|
||||
auto tree1 = std::get<0>(tup);
|
||||
auto tree2 = std::get<1>(tup);
|
||||
return diffTrees(path, *tree1, *tree2);
|
||||
|
Loading…
Reference in New Issue
Block a user