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

Commit 449dcc8

Browse files
authored
chore: silence clang-tidy warning on internal::Visit (#1239)
* chore: silence clang-tidy warning on internal::Visit * fixed tidy warning * fixed tidy warning again
1 parent 8e1f95c commit 449dcc8

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

google/cloud/spanner/client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ StatusOr<CommitResult> Client::Commit(
194194
} else {
195195
// Create a new transaction for the next loop, but reuse the session
196196
// so that we have a slightly better chance of avoiding another abort.
197-
txn = MakeReadWriteTransaction(std::move(txn));
197+
txn = MakeReadWriteTransaction(txn);
198198
}
199199
std::this_thread::sleep_for(backoff_policy->OnCompletion());
200200
}

google/cloud/spanner/integration_tests/client_integration_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ TEST_F(ClientIntegrationTest, TransactionRollback) {
175175

176176
// Share lock priority with the previous loop so that we have a slightly
177177
// better chance of avoiding StatusCode::kAborted from ExecuteDml().
178-
txn = MakeReadWriteTransaction(std::move(txn));
178+
txn = MakeReadWriteTransaction(txn);
179179

180180
auto insert1 = client_->ExecuteDml(
181181
txn, SqlStatement("INSERT INTO Singers (SingerId, FirstName, LastName) "

google/cloud/spanner/transaction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ inline Transaction MakeReadWriteTransaction(
205205
* success.
206206
*/
207207
inline Transaction MakeReadWriteTransaction(
208-
Transaction txn, Transaction::ReadWriteOptions opts = {}) {
208+
Transaction const& txn, Transaction::ReadWriteOptions opts = {}) {
209209
return Transaction(txn, std::move(opts));
210210
}
211211

@@ -219,6 +219,7 @@ Transaction MakeSingleUseTransaction(T&& opts) {
219219
}
220220

221221
template <typename Functor>
222+
// NOLINTNEXTLINE(performance-unnecessary-value-param)
222223
VisitInvokeResult<Functor> Visit(Transaction txn, Functor&& f) {
223224
return txn.impl_->Visit(std::forward<Functor>(f));
224225
}

0 commit comments

Comments
 (0)