Jump to content

Module:OutputBuffer: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Jackmcbarn (talk | contribs)
clear buffer after using
Jackmcbarn (talk | contribs)
m use the right table
Line 7: Line 7:
local b = buffer
local b = buffer
buffer = nil
buffer = nil
return table.concat(buffer, sep)
return table.concat(b, sep)
end
end
end
end

Revision as of 23:46, 25 June 2014

return function()
	local buffer = {}
	return function(text)
		buffer[#buffer + 1] = text
	end,
	function(sep)
		local b = buffer
		buffer = nil
		return table.concat(b, sep)
	end
end