@@ -34,7 +34,6 @@ local smatch = string.match
3434local sgsub = string.gsub
3535
3636local table = table
37- local tinsert = table.insert
3837local tconcat = table.concat
3938local unpack = table.unpack
4039local setmetatable = setmetatable
@@ -155,15 +154,15 @@ function String.Concat(...)
155154 local v = ...
156155 if System .isEnumerableLike (v ) then
157156 for _ , v in System .each (array ) do
158- tinsert ( t , v :ToString () )
157+ t [ # t + 1 ] = v :ToString ()
159158 end
160159 else
161160 return v :ToString ()
162161 end
163162 else
164163 for i = 1 , len do
165164 local v = select (i , ... )
166- tinsert ( t , v :ToString () )
165+ t [ # t + 1 ] = v :ToString ()
167166 end
168167 end
169168 return tconcat (t )
@@ -176,14 +175,14 @@ function String.Join(separator, value, startIndex, count)
176175 for i = startIndex + 1 , startIndex + count do
177176 local v = value :get (i )
178177 if v ~= nil then
179- tinsert ( t , v )
178+ t [ # t + 1 ] = v
180179 end
181180 end
182181 else
183182 for _ , v in System .each (value ) do
184183 if v ~= nil then
185- tinsert ( t , v )
186- end
184+ t [ # t + 1 ] = v
185+ end
187186 end
188187 end
189188 return tconcat (t , separator )
@@ -313,7 +312,7 @@ function String.ToCharArray(str, startIndex, count)
313312 startIndex , count = check (str , startIndex , count )
314313 local t = { }
315314 for i = startIndex + 1 , startIndex + count do
316- tinsert ( t , sbyte (str , i ) )
315+ t [ # t + 1 ] = sbyte (str , i )
317316 end
318317 return System .arrayFromTable (t , System .Char )
319318end
@@ -389,7 +388,7 @@ function String.Split(this, strings, count, options)
389388 posBegin = posBegin or 0
390389 local subStr = ssub (this , startIndex , posBegin - 1 )
391390 if options ~= 1 or # subStr > 0 then
392- tinsert ( t , subStr )
391+ t [ # t + 1 ] = subStr
393392 if count then
394393 count = count - 1
395394 if count == 0 then
@@ -446,4 +445,4 @@ function String.__inherits__()
446445end
447446
448447System .define (" System.String" , String )
449- setmetatable (String , { __index = System .Object , __call = ctor })
448+ setmetatable (String , { __index = System .Object , __call = ctor })
0 commit comments