@@ -922,7 +922,7 @@ void TreeInode::childMaterialized(
922
922
const RenameLock& renameLock,
923
923
PathComponentPiece childName) {
924
924
auto startTime = std::chrono::system_clock::now ();
925
- bool wasAlreadyMaterialized;
925
+ bool wasAlreadyMaterialized = false ;
926
926
{
927
927
auto contents = contents_.wlock ();
928
928
wasAlreadyMaterialized = contents->isMaterialized ();
@@ -980,7 +980,7 @@ void TreeInode::childDematerialized(
980
980
PathComponentPiece childName,
981
981
ObjectId childScmHash) {
982
982
auto startTime = std::chrono::system_clock::now ();
983
- bool wasAlreadyMaterialized;
983
+ bool wasAlreadyMaterialized = false ;
984
984
{
985
985
auto contents = contents_.wlock ();
986
986
wasAlreadyMaterialized = contents->isMaterialized ();
@@ -3041,6 +3041,7 @@ ImmediateFuture<Unit> TreeInode::computeDiff(
3041
3041
3042
3042
// Now process all of the deferred work.
3043
3043
std::vector<ImmediateFuture<Unit>> deferredFutures;
3044
+ deferredFutures.reserve (deferredEntries.size ());
3044
3045
for (auto & entry : deferredEntries) {
3045
3046
deferredFutures.push_back (entry->run ());
3046
3047
}
@@ -3058,7 +3059,7 @@ ImmediateFuture<Unit> TreeInode::computeDiff(
3058
3059
return collectAll (std::move (deferredFutures));
3059
3060
})
3060
3061
.thenValue ([self = std::move (self),
3061
- currentPath = RelativePath{std::move ( currentPath) },
3062
+ currentPath = RelativePath{currentPath},
3062
3063
context,
3063
3064
// Capture ignore to ensure it remains valid until all of our
3064
3065
// children's diff operations complete.
@@ -3907,7 +3908,7 @@ ImmediateFuture<InvalidationRequired> TreeInode::checkoutUpdateEntry(
3907
3908
CaseSensitivity::Insensitive);
3908
3909
}
3909
3910
3910
- bool inserted;
3911
+ bool inserted = false ;
3911
3912
{
3912
3913
auto contents = parentInode->contents_ .wlock ();
3913
3914
auto ret = contents->entries .emplace (
@@ -3961,7 +3962,7 @@ folly::Try<folly::Unit> TreeInode::nfsInvalidateCacheEntryForGC(
3961
3962
if (auto * nfsdChannel = getMount ()->getNfsdChannel ()) {
3962
3963
const auto path = getPath ();
3963
3964
if (path.has_value ()) {
3964
- // The contents lock is held by nfsInvalidateCacheEntryForGC
3965
+ // The contents lock is held by invalidateChildrenNotMaterialized
3965
3966
auto mode = getMetadataLocked (state.entries ).mode ;
3966
3967
nfsdChannel->invalidate (
3967
3968
getMount ()->getPath () + *path + name,
@@ -4404,9 +4405,10 @@ ImmediateFuture<uint64_t> TreeInode::invalidateChildrenNotMaterialized(
4404
4405
4405
4406
return getLoadedOrRememberedTreeChildren (this , getInodeMap (), context)
4406
4407
.thenValue ([context = context.copy (),
4407
- cutoff](std::vector<TreeInodePtr> treeChildren) {
4408
+ cutoff](const std::vector<TreeInodePtr>& treeChildren) {
4408
4409
std::vector<ImmediateFuture<uint64_t >> futures;
4409
4410
4411
+ futures.reserve (treeChildren.size ());
4410
4412
for (auto & tree : treeChildren) {
4411
4413
futures.push_back (
4412
4414
tree->invalidateChildrenNotMaterialized (cutoff, context));
0 commit comments