mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
store: silence howtoeven lint
Summary: HowToEven believes that both path and manifestNode might be used after being moved and thus complains about it as that's often what is intended. However, in C++17, this lint is spurious as both of these variables will be moved after being copied properly in the first lambda. To silence the linter, let's just split the combinator chain in 2. Reviewed By: genevievehelsel Differential Revision: D25627413 fbshipit-source-id: 1a93ca039310dfd04a3f11bd9c7de32e93057517
This commit is contained in:
parent
c0e4a5ce69
commit
ee48ba3dd6
@ -317,30 +317,32 @@ folly::Future<std::unique_ptr<Tree>> HgBackingStore::fetchTreeFromImporter(
|
||||
RelativePath path,
|
||||
std::optional<Hash> commitId,
|
||||
std::shared_ptr<LocalStore::WriteBatch> writeBatch) {
|
||||
return folly::via(
|
||||
importThreadPool_.get(),
|
||||
[path,
|
||||
manifestNode,
|
||||
stats = stats_,
|
||||
&liveImportTreeWatches = liveImportTreeWatches_] {
|
||||
Importer& importer = getThreadLocalImporter();
|
||||
folly::stop_watch<std::chrono::milliseconds> watch;
|
||||
RequestMetricsScope queueTracker{&liveImportTreeWatches};
|
||||
auto fut =
|
||||
folly::via(
|
||||
importThreadPool_.get(),
|
||||
[path,
|
||||
manifestNode,
|
||||
stats = stats_,
|
||||
&liveImportTreeWatches = liveImportTreeWatches_] {
|
||||
Importer& importer = getThreadLocalImporter();
|
||||
folly::stop_watch<std::chrono::milliseconds> watch;
|
||||
RequestMetricsScope queueTracker{&liveImportTreeWatches};
|
||||
|
||||
auto serializedTree = importer.fetchTree(path, manifestNode);
|
||||
stats->getHgBackingStoreStatsForCurrentThread()
|
||||
.hgBackingStoreImportTree.addValue(watch.elapsed().count());
|
||||
auto serializedTree = importer.fetchTree(path, manifestNode);
|
||||
stats->getHgBackingStoreStatsForCurrentThread()
|
||||
.hgBackingStoreImportTree.addValue(watch.elapsed().count());
|
||||
|
||||
return serializedTree;
|
||||
})
|
||||
.via(serverThreadPool_)
|
||||
.thenTry([this,
|
||||
ownedPath = std::move(path),
|
||||
node = std::move(manifestNode),
|
||||
treeID = std::move(edenTreeID),
|
||||
batch = std::move(writeBatch),
|
||||
commitId = std::move(commitId)](
|
||||
folly::Try<std::unique_ptr<IOBuf>> val) {
|
||||
return serializedTree;
|
||||
})
|
||||
.via(serverThreadPool_);
|
||||
|
||||
return std::move(fut).thenTry(
|
||||
[this,
|
||||
ownedPath = std::move(path),
|
||||
node = std::move(manifestNode),
|
||||
treeID = std::move(edenTreeID),
|
||||
batch = std::move(writeBatch),
|
||||
commitId = std::move(commitId)](folly::Try<std::unique_ptr<IOBuf>> val) {
|
||||
// Note: the `value` call will throw if fetchTree threw an exception
|
||||
auto iobuf = std::move(val).value();
|
||||
return processTree(
|
||||
|
Loading…
Reference in New Issue
Block a user