mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] add two-operand version of max and use max2 in stdlib when appropriate.
This helps array append's performance by ~ 2x. The generic max with a variadic argument creates a temporary array then iterates over the array. rdar://17140639 rdar://17073827 Swift SVN r18764
This commit is contained in:
@@ -90,7 +90,7 @@ struct _StringBuffer {
|
||||
|
||||
// Allocate storage
|
||||
self = _StringBuffer(
|
||||
capacity: max(utf16Count, minimumCapacity),
|
||||
capacity: max2(utf16Count, minimumCapacity),
|
||||
initialSize: utf16Count,
|
||||
elementWidth: isAscii ? 1 : 2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user