Skip to content

Commit

Permalink
use table.concat instead of string.concat
Browse files Browse the repository at this point in the history
when packing packed pixels
  • Loading branch information
SwissalpS committed Oct 26, 2024
1 parent 13cc1fd commit cc0e860
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gpu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,13 @@ local function runcommand(pos, meta, command)
if type(command.channel) ~= "string" then
return
end
local packeddata = ""
local packedtable = {}
for y = 1, buffer.ysize do
for x = 1, buffer.xsize do
packeddata = packeddata .. packpixel(buffer[y][x])
table.insert(packedtable, packpixel(buffer[y][x]))
end
end
local packeddata = table.concat(packedtable, "")
digilines.receptor_send(pos, digilines.rules.default,
command.channel, packeddata)
elseif command.command == "loadpacked" then
Expand Down

0 comments on commit cc0e860

Please sign in to comment.