lib/protobuf/message/serialization.rb in protobuf-3.6.6 vs lib/protobuf/message/serialization.rb in protobuf-3.6.7

- old
+ new

@@ -46,15 +46,13 @@ end # Encode this message # def encode - @encode ||= begin - stream = ::StringIO.new - stream.set_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) - encode_to(stream) - stream.string - end + stream = ::StringIO.new + stream.set_encoding(::Protobuf::Field::BytesField::BYTES_ENCODING) + encode_to(stream) + stream.string end # Encode this message to the given stream. # def encode_to(stream)