File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,11 +149,11 @@ MessageBuilder& MessageBuilder::setReplicationClusters(const std::vector<std::st
149149
150150MessageBuilder& 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
Original file line number Diff line number Diff line change @@ -61,11 +61,11 @@ void MessageImpl::setReplicationClusters(const std::vector<std::string>& cluster
6161}
6262
6363void 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
7171void MessageImpl::setProperty (const std::string& name, const std::string& value) {
You can’t perform that action at this time.
0 commit comments