Blame view

src/utils/TableUtil.lua 221 Bytes
be83d162   zhouahaihai   登陆成功。 增加数据结构修正功能
1
2
3
4
5
6
7
  function table.arrayToMap(tab)
  	local len = #tab
  	local result = {}
  	for i = 1, len, 2 do
  		result[tab[i]] = tab[i + 1]
  	end
  	return result
23d89d13   zhouahaihai   冒险 结构
8
9
10
11
12
13
  end
  
  function table.clear(tab)
  	for k, _ in pairs(tab) do
  		tab[k] = nil
  	end
be83d162   zhouahaihai   登陆成功。 增加数据结构修正功能
14
  end