--[[ @brief Copies a table.
     @param t The table to copy.
     @return The copied table.
--]]

function module.ShallowTableCopy(t)
	local s = {};
	for i, v in pairs(t) do
		s[i] = v;
	end
	return s;
end

function module.ArrayCopyOnCondition(t, c)
	local s = {};
	for i, v in pairs(t) do
		if c(v) then
			table.insert(s, v);
		end
	end
	return s;
end

module.ShallowCopy = module.ShallowTableCopy;
