Skip to content

Commit f6a28d8

Browse files
committed
stdlib: enable a check for a special case in Array.append(contentsOf:)
The check for the special case if the sequence is an Array was disabled in embedded swift. It can be enabled because we now remove the cast after specialization. Saves some code size when appending one array to another array.
1 parent 1d4054c commit f6a28d8

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

stdlib/public/core/Array.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,6 @@ extension Array: RangeReplaceableCollection {
12541254

12551255
if _slowPath(writtenUpTo == buf.endIndex) {
12561256

1257-
#if !$Embedded
12581257
// A shortcut for appending an Array: If newElements is an Array then it's
12591258
// guaranteed that buf.initialize(from: newElements) already appended all
12601259
// elements. It reduces code size, because the following code
@@ -1264,7 +1263,6 @@ extension Array: RangeReplaceableCollection {
12641263
_internalInvariant(remainder.next() == nil)
12651264
return
12661265
}
1267-
#endif
12681266

12691267
// there may be elements that didn't fit in the existing buffer,
12701268
// append them in slow sequence-only mode

0 commit comments

Comments
 (0)