Skip to content

Commit af356c1

Browse files
committed
Fix type initialization and pointer declaration
Signed-off-by: Venil Noronha <[email protected]>
1 parent 9dce4f5 commit af356c1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

source/common/tcp_proxy/tcp_proxy.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ Config::Config(const envoy::config::filter::network::tcp_proxy::v2::TcpProxy& co
8484
total_cluster_weight_ = 0;
8585
for (const envoy::config::filter::network::tcp_proxy::v2::TcpProxy::WeightedCluster::
8686
ClusterWeight& cluster_desc : config.weighted_clusters().clusters()) {
87-
std::unique_ptr<WeightedClusterEntry> cluster_entry(new WeightedClusterEntry(cluster_desc));
87+
std::unique_ptr<WeightedClusterEntry> cluster_entry(
88+
std::make_unique<WeightedClusterEntry>(cluster_desc));
8889
weighted_clusters_.emplace_back(std::move(cluster_entry));
8990
total_cluster_weight_ += weighted_clusters_.back()->clusterWeight();
9091
}

source/common/tcp_proxy/tcp_proxy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class Config {
139139
const std::string cluster_name_;
140140
const uint64_t cluster_weight_;
141141
};
142-
typedef std::shared_ptr<WeightedClusterEntry> WeightedClusterEntrySharedPtr;
142+
typedef std::unique_ptr<WeightedClusterEntry> WeightedClusterEntrySharedPtr;
143143

144144
std::vector<Route> routes_;
145145
std::vector<WeightedClusterEntrySharedPtr> weighted_clusters_;

0 commit comments

Comments
 (0)