Skip to content

Commit b539a14

Browse files
authored
cleanup: prepare for clang-tidy 18 (googleapis#14160)
Remove redundant inline
1 parent 6c959f4 commit b539a14

11 files changed

Lines changed: 24 additions & 32 deletions

File tree

google/cloud/bigquery/v2/minimal/internal/dataset_retry_policy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2626

2727
// Rest status code semantics for retrying requests.
2828
struct DatasetRetryTraits {
29-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
29+
static bool IsPermanentFailure(google::cloud::Status const& status) {
3030
return status.code() != StatusCode::kResourceExhausted &&
3131
status.code() != StatusCode::kUnavailable;
3232
}

google/cloud/bigquery/v2/minimal/internal/job_retry_policy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2828

2929
// Rest status code semantics for retrying requests.
3030
struct BigQueryJobRetryTraits {
31-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
31+
static bool IsPermanentFailure(google::cloud::Status const& status) {
3232
return status.code() != StatusCode::kDeadlineExceeded &&
3333
status.code() != StatusCode::kResourceExhausted &&
3434
status.code() != StatusCode::kUnavailable;

google/cloud/bigquery/v2/minimal/internal/project_retry_policy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2626

2727
// Rest status code semantics for retrying requests.
2828
struct ProjectRetryTraits {
29-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
29+
static bool IsPermanentFailure(google::cloud::Status const& status) {
3030
return status.code() != StatusCode::kResourceExhausted &&
3131
status.code() != StatusCode::kUnavailable;
3232
}

google/cloud/bigquery/v2/minimal/internal/table_retry_policy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2626

2727
// Rest status code semantics for retrying requests.
2828
struct TableRetryTraits {
29-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
29+
static bool IsPermanentFailure(google::cloud::Status const& status) {
3030
return status.code() != StatusCode::kResourceExhausted &&
3131
status.code() != StatusCode::kUnavailable;
3232
}

google/cloud/bigtable/internal/retry_traits.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2828

2929
/// An adapter to use `grpc::Status` with the `google::cloud::*Policies`.
3030
struct SafeGrpcRetry {
31-
static inline bool IsOk(Status const& status) { return status.ok(); }
32-
static inline bool IsTransientFailure(Status const& status) {
31+
static bool IsOk(Status const& status) { return status.ok(); }
32+
static bool IsTransientFailure(Status const& status) {
3333
auto const code = status.code();
3434
return code == StatusCode::kAborted || code == StatusCode::kUnavailable ||
3535
google::cloud::internal::IsTransientInternalError(status);
3636
}
37-
static inline bool IsPermanentFailure(Status const& status) {
37+
static bool IsPermanentFailure(Status const& status) {
3838
return !IsOk(status) && !IsTransientFailure(status);
3939
}
4040

4141
// TODO(#2344) - remove ::grpc::Status version.
42-
static inline bool IsOk(grpc::Status const& status) { return status.ok(); }
43-
static inline bool IsTransientFailure(grpc::Status const& status) {
42+
static bool IsOk(grpc::Status const& status) { return status.ok(); }
43+
static bool IsTransientFailure(grpc::Status const& status) {
4444
return IsTransientFailure(MakeStatusFromRpcError(status));
4545
}
46-
static inline bool IsPermanentFailure(grpc::Status const& status) {
46+
static bool IsPermanentFailure(grpc::Status const& status) {
4747
return !IsOk(status) && !IsTransientFailure(status);
4848
}
4949
};

google/cloud/internal/oauth2_compute_engine_credentials.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ DoMetadataServerGetRequest(rest_internal::RestClient& client,
4747
}
4848

4949
struct DefaultUniverseDomainRetryTraits {
50-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
50+
static bool IsPermanentFailure(google::cloud::Status const& status) {
5151
return status.code() != StatusCode::kOk &&
5252
status.code() != StatusCode::kUnavailable;
5353
}

google/cloud/internal/retry_info.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class RetryInfo {
3737

3838
std::chrono::nanoseconds retry_delay() const { return retry_delay_; }
3939

40-
friend inline bool operator==(RetryInfo const& a, RetryInfo const& b) {
40+
friend bool operator==(RetryInfo const& a, RetryInfo const& b) {
4141
return a.retry_delay_ == b.retry_delay_;
4242
}
4343

44-
friend inline bool operator!=(RetryInfo const& a, RetryInfo const& b) {
44+
friend bool operator!=(RetryInfo const& a, RetryInfo const& b) {
4545
return !(a == b);
4646
}
4747

google/cloud/pubsub/retry_policy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace pubsub_internal {
2727
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2828
/// Define the gRPC status code semantics for retrying requests.
2929
struct RetryTraits {
30-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
30+
static bool IsPermanentFailure(google::cloud::Status const& status) {
3131
return status.code() != StatusCode::kOk &&
3232
status.code() != StatusCode::kAborted &&
3333
status.code() != StatusCode::kInternal &&

google/cloud/spanner/retry_policy.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,24 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
2828

2929
/// Define the gRPC status code semantics for retrying requests.
3030
struct SafeGrpcRetry {
31-
static inline bool IsOk(google::cloud::Status const& status) {
32-
return status.ok();
33-
}
34-
static inline bool IsTransientFailure(google::cloud::Status const& status) {
31+
static bool IsOk(google::cloud::Status const& status) { return status.ok(); }
32+
static bool IsTransientFailure(google::cloud::Status const& status) {
3533
return status.code() == StatusCode::kUnavailable ||
3634
status.code() == StatusCode::kResourceExhausted ||
3735
internal::IsTransientInternalError(status);
3836
}
39-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
37+
static bool IsPermanentFailure(google::cloud::Status const& status) {
4038
return !IsOk(status) && !IsTransientFailure(status);
4139
}
4240
};
4341

4442
/// Define the gRPC status code semantics for rerunning transactions.
4543
struct SafeTransactionRerun {
46-
static inline bool IsOk(google::cloud::Status const& status) {
47-
return status.ok();
48-
}
49-
static inline bool IsTransientFailure(google::cloud::Status const& status) {
44+
static bool IsOk(google::cloud::Status const& status) { return status.ok(); }
45+
static bool IsTransientFailure(google::cloud::Status const& status) {
5046
return status.code() == StatusCode::kAborted || IsSessionNotFound(status);
5147
}
52-
static inline bool IsPermanentFailure(google::cloud::Status const& status) {
48+
static bool IsPermanentFailure(google::cloud::Status const& status) {
5349
return !IsOk(status) && !IsTransientFailure(status);
5450
}
5551
};

google/cloud/status.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,13 @@ class Status::Impl {
108108
// `internal::SetPayload()` function.
109109
PayloadType& payload() { return payload_; }
110110

111-
friend inline bool operator==(Impl const& a, Impl const& b) {
111+
friend bool operator==(Impl const& a, Impl const& b) {
112112
return a.code_ == b.code_ && a.message_ == b.message_ &&
113113
a.error_info_ == b.error_info_ && a.retry_info_ == b.retry_info_ &&
114114
a.payload_ == b.payload_;
115115
}
116116

117-
friend inline bool operator!=(Impl const& a, Impl const& b) {
118-
return !(a == b);
119-
}
117+
friend bool operator!=(Impl const& a, Impl const& b) { return !(a == b); }
120118

121119
private:
122120
StatusCode code_;

0 commit comments

Comments
 (0)