Skip to content

Commit 6ee712c

Browse files
authored
Fix a use after move warning (#11256)
1 parent cead230 commit 6ee712c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Firestore/core/src/model/mutation_batch.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ absl::optional<FieldMask> MutationBatch::ApplyToLocalDocument(
9797
// TODO(dconeybe) Replace absl::nullopt with a FieldMask?
9898
auto new_mutated_fields = mutation.ApplyToLocalView(
9999
document, std::move(mutated_fields), local_write_time_);
100-
mutated_fields.swap(new_mutated_fields);
100+
mutated_fields = std::move(new_mutated_fields);
101101
}
102102
}
103103

@@ -106,7 +106,7 @@ absl::optional<FieldMask> MutationBatch::ApplyToLocalDocument(
106106
if (mutation.key() == document.key()) {
107107
auto new_mutated_fields = mutation.ApplyToLocalView(
108108
document, std::move(mutated_fields), local_write_time_);
109-
mutated_fields.swap(new_mutated_fields);
109+
mutated_fields = std::move(new_mutated_fields);
110110
}
111111
}
112112

0 commit comments

Comments
 (0)