diff options
author | 2016-08-04 14:42:35 -0700 | |
---|---|---|
committer | 2016-08-04 14:42:35 -0700 | |
commit | a7ee93864a2e822ec510dccec19012e59acdeb7d (patch) | |
tree | 17c61171065cb52531059393c3c40f5eddf8bb74 /include | |
parent | 76db7f9a7cdf6b5fd6706037c72de1dd131b181e (diff) |
remove const in Deserialize
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc++/impl/codegen/thrift_serializer.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/grpc++/impl/codegen/thrift_serializer.h b/include/grpc++/impl/codegen/thrift_serializer.h index fcb0ffaad6..7308a1577c 100644 --- a/include/grpc++/impl/codegen/thrift_serializer.h +++ b/include/grpc++/impl/codegen/thrift_serializer.h @@ -122,8 +122,7 @@ class ThriftSerializer { // Deserialize the passed char array into the passed type, returns the number // of bytes that have been consumed from the passed string. template <typename T> - uint32_t Deserialize(const uint8_t* serialized_buffer, size_t length, - T* fields) { + uint32_t Deserialize(uint8_t* serialized_buffer, size_t length, T* fields) { // prepare buffer if necessary if (!prepared_) { prepare(); @@ -131,7 +130,7 @@ class ThriftSerializer { last_deserialized_ = true; // reset buffer transport - buffer_->resetBuffer(const_cast<uint8_t*>(serialized_buffer), length); + buffer_->resetBuffer(serialized_buffer, length); // read the protocol version if necessary if (serialize_version_) { @@ -200,10 +199,9 @@ class ThriftSerializer { bool serialize_version_; void prepare() { - buffer_ = boost::make_shared<TMemoryBuffer>(*(new TMemoryBuffer())); + buffer_ = boost::make_shared<TMemoryBuffer>(); // create a protocol for the memory buffer transport - protocol_ = std::make_shared<Protocol>(*(new Protocol(buffer_))); - + protocol_ = std::make_shared<Protocol>(buffer_); prepared_ = true; } |