AP_Scripting: mavlink: remove redundant Lua buffer usage

This commit is contained in:
Thomas Watson authored and Andrew Tridgell committed 2025-02-11 10:26:59 +11:00
1 parent 2b995b2087
commit 55a0cbbd9a
1 file changed
+1 -4
+1 -4
View File
@@ -105,10 +105,7 @@ int lua_mavlink_receive_chan(lua_State *L) {
}
if (rx_buffer->pop(msg)) {
luaL_Buffer b;
luaL_buffinit(L, &b);
luaL_addlstring(&b, (char *)&msg.msg, sizeof(msg.msg));
luaL_pushresult(&b);
lua_pushlstring(L, (char *)&msg.msg, sizeof(msg.msg));
lua_pushinteger(L, msg.chan);
*new_uint32_t(L) = msg.timestamp_ms;
return 3;