File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ function Dictionary:Remove(key)
4444end
4545
4646function Dictionary :Clear ()
47- for _ , key in ipairs ( self .m_index ) do
48- self : Remove ( key )
49- end
47+ self .m_count = 0
48+ self . m_dict = {}
49+ self . m_index = {}
5050end
5151
5252--- @return number
Original file line number Diff line number Diff line change 11---- ---------------ModuleInfo-------------------
22--- Author : jxy
33--- Date : 2020/02/16 00:00
4- --- Description : 数组封装类,可以用lua迭代器访问
4+ --- Description : 数组封装类
55--- https://github.com/JomiXedYu/JxCode.LuaSharp
66---- --------------------------------------------
77--- @class SysLib.Collections.List : SysLib.Object
@@ -21,8 +21,8 @@ function List:Add(item)
2121 self .m_arr [self .m_count ] = item
2222end
2323
24- function List :AddRange (ienumerator )
25- for item in each (ienumerator ) do
24+ function List :AddRange (enumerable )
25+ for item in each (enumerable ) do
2626 self :Add (item )
2727 end
2828end
@@ -49,6 +49,7 @@ function List:Clear()
4949 for i = 1 , self .m_count do
5050 self .m_arr [i ] = nil
5151 end
52+ self .m_count = 0
5253end
5354
5455--- @return boolean
You can’t perform that action at this time.
0 commit comments