File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -241,3 +241,28 @@ public func run_ArrayAppendToFromGeneric(_ N: Int) {
241
241
}
242
242
}
243
243
244
+ // Append a single element array with the += operator
245
+ @inline ( never)
246
+ public func run_ArrayPlusEqualSingleElementCollection( _ N: Int ) {
247
+ for _ in 0 ..< N {
248
+ for _ in 0 ..< 10 {
249
+ var nums = [ Int] ( )
250
+ for _ in 0 ..< 40_000 {
251
+ nums += [ 1 ]
252
+ }
253
+ }
254
+ }
255
+ }
256
+
257
+ // Append a five element array with the += operator
258
+ @inline ( never)
259
+ public func run_ArrayPlusEqualFiveElementCollection( _ N: Int ) {
260
+ for _ in 0 ..< N {
261
+ for _ in 0 ..< 10 {
262
+ var nums = [ Int] ( )
263
+ for _ in 0 ..< 40_000 {
264
+ nums += [ 1 , 2 , 3 , 4 , 5 ]
265
+ }
266
+ }
267
+ }
268
+ }
Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ precommitTests = [
121
121
" ArrayAppendStrings " : run_ArrayAppendStrings,
122
122
" ArrayAppendToFromGeneric " : run_ArrayAppendToFromGeneric,
123
123
" ArrayAppendToGeneric " : run_ArrayAppendToGeneric,
124
+ " ArrayPlusEqualSingleElementCollection " : run_ArrayPlusEqualSingleElementCollection,
125
+ " ArrayPlusEqualFiveElementCollection " : run_ArrayPlusEqualFiveElementCollection,
124
126
" ArrayInClass " : run_ArrayInClass,
125
127
" ArrayLiteral " : run_ArrayLiteral,
126
128
" ArrayOfGenericPOD " : run_ArrayOfGenericPOD,
You can’t perform that action at this time.
0 commit comments