mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-26 23:01:04 +08:00
Merge pull request #1938 from hitstergtd/decoder-fix
Problem: style issues in decoder.hpp
This commit is contained in:
commit
89ef8b38c0
@ -119,7 +119,8 @@ namespace zmq
|
||||
bytes_used_ = size_;
|
||||
|
||||
while (!to_read) {
|
||||
const int rc = (static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
||||
const int rc =
|
||||
(static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
}
|
||||
@ -128,11 +129,11 @@ namespace zmq
|
||||
|
||||
while (bytes_used_ < size_) {
|
||||
// Copy the data from buffer to the message.
|
||||
const std::size_t to_copy = std::min (to_read, size_ - bytes_used_);
|
||||
// only copy when the destination address is different from the
|
||||
// current address in the buffer
|
||||
const size_t to_copy = std::min (to_read, size_ - bytes_used_);
|
||||
// Only copy when destination address is different from the
|
||||
// current address in the buffer.
|
||||
if (read_pos != data_ + bytes_used_) {
|
||||
std::memcpy (read_pos, data_ + bytes_used_, to_copy);
|
||||
memcpy (read_pos, data_ + bytes_used_, to_copy);
|
||||
}
|
||||
|
||||
read_pos += to_copy;
|
||||
@ -142,7 +143,8 @@ namespace zmq
|
||||
// If none is available, return.
|
||||
while (to_read == 0) {
|
||||
// pass current address in the buffer
|
||||
const int rc = (static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
||||
const int rc =
|
||||
(static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user