mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 16:53:33 +08:00
Minor optimization for publisher
This commit is contained in:
@@ -69,15 +69,16 @@ private:
|
|||||||
if (!buf)
|
if (!buf)
|
||||||
return -1;
|
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
|
BitStream bitstream(*buf);
|
||||||
return -1;
|
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(),
|
return sender_->send(buf->getDataPtr(), buf->getDataLength(), getTxDeadline(),
|
||||||
monotonic_blocking_deadline, transfer_type, dst_node_id);
|
monotonic_blocking_deadline, transfer_type, dst_node_id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user