Skip to content

Commit

Permalink
formatter: removes unused getHostNameOrDefault (envoyproxy#34984)
Browse files Browse the repository at this point in the history
Previously getHostNameOrDefault was used to resolve HOSTNAME substitution, but now it's implemented via const absl::optional<std::string> getHostname(), and getHostNameOrDefault hasn't been used since then.
As a result, this would increase the test coverage of substitution_format_utility.cc.

Risk Level: lo
Testing: done
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Takeshi Yoneda <[email protected]>
  • Loading branch information
mathetake authored Jul 1, 2024
1 parent 7a9e910 commit 266077f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
8 changes: 0 additions & 8 deletions source/common/formatter/substitution_format_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ const absl::optional<std::string> SubstitutionFormatUtils::getHostname() {
return hostname;
}

const std::string SubstitutionFormatUtils::getHostnameOrDefault() {
absl::optional<std::string> hostname = getHostname();
if (hostname.has_value()) {
return hostname.value();
}
return DefaultUnspecifiedValueString;
}

const ProtobufWkt::Value& SubstitutionFormatUtils::unspecifiedValue() {
return ValueUtil::nullValue();
}
Expand Down
1 change: 0 additions & 1 deletion source/common/formatter/substitution_format_utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class SubstitutionFormatUtils {
static const std::string&
protocolToStringOrDefault(const absl::optional<Http::Protocol>& protocol);
static const absl::optional<std::string> getHostname();
static const std::string getHostnameOrDefault();

/**
* Unspecified value for protobuf.
Expand Down

0 comments on commit 266077f

Please sign in to comment.