File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,18 @@ bool PythonConstMessagePointer::NotChanged() {
101101 std::unique_ptr<google::protobuf::Message> parsed_msg (owned_msg_->New ());
102102 parsed_msg->ParseFromArray (data, static_cast <int >(len));
103103 std::string wire_other;
104- parsed_msg->SerializeToString (&wire_other);
104+ google::protobuf::io::StringOutputStream stream_other (&wire_other);
105+ google::protobuf::io::CodedOutputStream output_other (&stream_other);
106+ output_other.SetSerializationDeterministic (true );
107+ parsed_msg->SerializeToCodedStream (&output_other);
108+ output_other.Trim ();
105109
106110 std::string wire;
107- owned_msg_->SerializeToString (&wire);
111+ google::protobuf::io::StringOutputStream stream (&wire);
112+ google::protobuf::io::CodedOutputStream output (&stream);
113+ output.SetSerializationDeterministic (true );
114+ owned_msg_->SerializeToCodedStream (&output);
115+ output.Trim ();
108116
109117 if (wire == wire_other) {
110118 Py_DECREF (py_serialized_pb);
You can’t perform that action at this time.
0 commit comments