From 55a0cbbd9aa50dce545220a5fdd65ee5904eb9e0 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sat, 8 Feb 2025 13:57:27 -0600 Subject: [PATCH] AP_Scripting: mavlink: remove redundant Lua buffer usage --- libraries/AP_Scripting/lua_bindings.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/AP_Scripting/lua_bindings.cpp b/libraries/AP_Scripting/lua_bindings.cpp index f17cc0074a9..1c15d8ddafe 100644 --- a/libraries/AP_Scripting/lua_bindings.cpp +++ b/libraries/AP_Scripting/lua_bindings.cpp @@ -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;