mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Minor optimization for publisher
This commit is contained in:
parent
8bd1dd01e9
commit
0afb7f4eea
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user