Skip to content

Commit

Permalink
perf: use absl string append (envoyproxy#28959)
Browse files Browse the repository at this point in the history
Signed-off-by: Boteng Yao <[email protected]>
  • Loading branch information
botengyao authored Aug 11, 2023
1 parent f2e5620 commit c1abe8a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/common/router/header_parser_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std::string HeaderParser::translateMetadataFormat(const std::string& header_valu
}
new_format = parsed_params->asObjectArray()[0]->asString();
for (size_t i = 1; i < parsed_params->asObjectArray().size(); i++) {
new_format += ":" + parsed_params->asObjectArray()[i]->asString();
absl::StrAppend(&new_format, ":", parsed_params->asObjectArray()[i]->asString());
}

new_format = absl::StrCat("%", matches[1], "_METADATA(", new_format, ")%");
Expand Down
2 changes: 1 addition & 1 deletion source/common/runtime/runtime_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ SnapshotImplPtr LoaderImpl::createNewSnapshot() {
std::string path =
layer.disk_layer().symlink_root() + "/" + layer.disk_layer().subdirectory();
if (layer.disk_layer().append_service_cluster()) {
path += "/" + service_cluster_;
absl::StrAppend(&path, "/", service_cluster_);
}
if (api_.fileSystem().directoryExists(path)) {
TRY_ASSERT_MAIN_THREAD {
Expand Down
4 changes: 2 additions & 2 deletions source/extensions/filters/udp/dns_filter/dns_filter_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ std::string buildServiceName(const std::string& name, const std::string& proto,
if (name[0] != '_') {
result += "_";
}
result += name + ".";
absl::StrAppend(&result, name, ".");
if (proto[0] != '_') {
result += "_";
}
result += proto + '.' + domain;
absl::StrAppend(&result, proto, ".", domain);
return result;
}

Expand Down

0 comments on commit c1abe8a

Please sign in to comment.