mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-10 03:18:53 +08:00
Minor optimization for publisher
This commit is contained in:
@@ -69,15 +69,16 @@ private:
|
||||
if (!buf)
|
||||
return -1;
|
||||
|
||||
BitStream bitstream(*buf);
|
||||
ScalarCodec codec(bitstream);
|
||||
const int encode_res = DataType::encode(message, codec);
|
||||
if (encode_res <= 0)
|
||||
{
|
||||
assert(0); // Impossible, internal error
|
||||
return -1;
|
||||
BitStream bitstream(*buf);
|
||||
ScalarCodec codec(bitstream);
|
||||
const int encode_res = DataType::encode(message, codec);
|
||||
if (encode_res <= 0)
|
||||
{
|
||||
assert(0); // Impossible, internal error
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return sender_->send(buf->getDataPtr(), buf->getDataLength(), getTxDeadline(),
|
||||
monotonic_blocking_deadline, transfer_type, dst_node_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user