Skip to content

Commit 8ed48d3

Browse files
committed
fix ubuntu build
1 parent b628011 commit 8ed48d3

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/MessageBuilder.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ MessageBuilder& MessageBuilder::setReplicationClusters(const std::vector<std::st
149149

150150
MessageBuilder& MessageBuilder::disableReplication(bool flag) {
151151
checkMetadata();
152-
google::protobuf::RepeatedPtrField<std::string> r;
152+
google::protobuf::RepeatedPtrField<std::string>* replicateTo = impl_->metadata.mutable_replicate_to();
153+
replicateTo->Clear();
153154
if (flag) {
154-
r.AddAllocated(new std::string("__local__"));
155+
replicateTo->Add("__local__");
155156
}
156-
r.Swap(impl_->metadata.mutable_replicate_to());
157157
return *this;
158158
}
159159

lib/MessageImpl.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ void MessageImpl::setReplicationClusters(const std::vector<std::string>& cluster
6161
}
6262

6363
void MessageImpl::disableReplication(bool flag) {
64-
google::protobuf::RepeatedPtrField<std::string> r;
64+
google::protobuf::RepeatedPtrField<std::string>* replicateTo = metadata.mutable_replicate_to();
65+
replicateTo->Clear();
6566
if (flag) {
66-
r.AddAllocated(new std::string("__local__"));
67+
replicateTo->Add("__local__");
6768
}
68-
r.Swap(metadata.mutable_replicate_to());
6969
}
7070

7171
void MessageImpl::setProperty(const std::string& name, const std::string& value) {

0 commit comments

Comments
 (0)