Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 01b696d

Browse files
authored
chore: explain use of "performance-unnecessary-value-param" (#1244)
For future reference, document the clang-tidy warning suppression.
1 parent 8c1ef9d commit 01b696d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

google/cloud/spanner/transaction.h

+3
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ Transaction MakeSingleUseTransaction(T&& opts) {
219219
}
220220

221221
template <typename Functor>
222+
// Pass `txn` by value, despite being used only once. This avoids the
223+
// possibility of `txn` being destroyed by `f` before `Visit()` can
224+
// return. Therefore, ...
222225
// NOLINTNEXTLINE(performance-unnecessary-value-param)
223226
VisitInvokeResult<Functor> Visit(Transaction txn, Functor&& f) {
224227
return txn.impl_->Visit(std::forward<Functor>(f));

0 commit comments

Comments
 (0)