[build] Remove str_format.h from server_address.h (#29524)

This file gets included by resolver, which gets included by
core_configuration, which in turn sprays this inclusion everywhere (and
it's a costly file to parse)
pull/29528/head
Craig Tiller 3 years ago committed by GitHub
parent 53e382729f
commit 6b00bc7516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 1
      src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
  3. 6
      src/core/lib/resolver/server_address.cc
  4. 5
      src/core/lib/resolver/server_address.h
  5. 2
      test/core/http/httpcli_test.cc
  6. 2
      test/core/http/httpscli_test.cc

@ -2845,6 +2845,7 @@ grpc_cc_library(
"absl/hash",
"absl/memory",
"absl/strings",
"absl/strings:str_format",
"upb_lib",
],
language = "c++",

@ -38,6 +38,7 @@
#include "absl/hash/hash.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
#include "absl/strings/strip.h"

@ -25,6 +25,7 @@
#include <vector>
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "src/core/lib/address_utils/sockaddr_utils.h"
@ -80,6 +81,7 @@ ServerAddress::ServerAddress(ServerAddress&& other) noexcept
attributes_(std::move(other.attributes_)) {
other.args_ = nullptr;
}
ServerAddress& ServerAddress::operator=(ServerAddress&& other) noexcept {
address_ = other.address_;
grpc_channel_args_destroy(args_);
@ -167,4 +169,8 @@ std::string ServerAddress::ToString() const {
return absl::StrJoin(parts, " ");
}
std::string ServerAddressWeightAttribute::ToString() const {
return absl::StrFormat("%d", weight_);
}
} // namespace grpc_core

@ -25,7 +25,6 @@
#include <memory>
#include "absl/container/inlined_vector.h"
#include "absl/strings/str_format.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
@ -134,9 +133,7 @@ class ServerAddressWeightAttribute : public ServerAddress::AttributeInterface {
return QsortCompare(weight_, other_locality_attr->weight_);
}
std::string ToString() const override {
return absl::StrFormat("%d", weight_);
}
std::string ToString() const override;
private:
uint32_t weight_;

@ -23,6 +23,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/strings/str_format.h"
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

@ -21,6 +21,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/strings/str_format.h"
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

Loading…
Cancel
Save