Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 52fb442

Browse files
authored
Zipkin exporter nits. (#346)
- Depend on absl/time directly instead of transitively. - Simplify string::compare calls.
1 parent 00cb577 commit 52fb442

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

opencensus/exporters/trace/zipkin/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ cc_library(
3737
"@com_google_absl//absl/base:core_headers",
3838
"@com_google_absl//absl/memory",
3939
"@com_google_absl//absl/strings",
40+
"@com_google_absl//absl/time",
4041
],
4142
)
4243

opencensus/exporters/trace/zipkin/internal/zipkin_exporter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ std::string GetIpAddressHelper(ZipkinExporterOptions::AddressFamily af_type,
189189
->sin_addr),
190190
address, INET_ADDRSTRLEN);
191191
std::string ipv4_address(address);
192-
if (ipv4_address.compare(ipv4_loopback) == 0) continue;
192+
if (ipv4_address == ipv4_loopback) continue;
193193
return ipv4_address;
194194
} else if (if_address->ifa_addr->sa_family == AF_INET6) {
195195
if (af_type != ZipkinExporterOptions::AddressFamily::kIpv6) continue;
@@ -199,7 +199,7 @@ std::string GetIpAddressHelper(ZipkinExporterOptions::AddressFamily af_type,
199199
->sin6_addr),
200200
address, INET6_ADDRSTRLEN);
201201
std::string ipv6_address(address);
202-
if (ipv6_address.compare(ipv6_loopback) == 0) continue;
202+
if (ipv6_address == ipv6_loopback) continue;
203203
return ipv6_address;
204204
}
205205
}

0 commit comments

Comments
 (0)