Fix clang-tidy (#28717)

pull/28757/head
Esun Kim 3 years ago committed by GitHub
parent 781100f765
commit 33f5a5bb2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/ext/xds/xds_routing.cc
  2. 2
      src/core/lib/security/security_connector/ssl_utils.cc

@ -70,7 +70,7 @@ bool DomainMatch(MatchType match_type, absl::string_view domain_pattern_in,
MatchType DomainPatternMatchType(absl::string_view domain_pattern) { MatchType DomainPatternMatchType(absl::string_view domain_pattern) {
if (domain_pattern.empty()) return INVALID_MATCH; if (domain_pattern.empty()) return INVALID_MATCH;
if (domain_pattern.find('*') == std::string::npos) return EXACT_MATCH; if (!absl::StrContains(domain_pattern, '*')) return EXACT_MATCH;
if (domain_pattern == "*") return UNIVERSE_MATCH; if (domain_pattern == "*") return UNIVERSE_MATCH;
if (domain_pattern[0] == '*') return SUFFIX_MATCH; if (domain_pattern[0] == '*') return SUFFIX_MATCH;
if (domain_pattern[domain_pattern.size() - 1] == '*') return PREFIX_MATCH; if (domain_pattern[domain_pattern.size() - 1] == '*') return PREFIX_MATCH;

@ -233,7 +233,7 @@ static bool IsSpiffeId(absl::string_view uri) {
return false; return false;
} }
std::vector<absl::string_view> splits = absl::StrSplit(uri, '/'); std::vector<absl::string_view> splits = absl::StrSplit(uri, '/');
if (splits.size() < 4 || splits[3] == "") { if (splits.size() < 4 || splits[3].empty()) {
gpr_log(GPR_INFO, "Invalid SPIFFE ID: workload id is empty."); gpr_log(GPR_INFO, "Invalid SPIFFE ID: workload id is empty.");
return false; return false;
} }

Loading…
Cancel
Save