mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] use noinline to get rid of closure.
Remove wrapping the callee in a closure to disable inlining, instead mark callee as noinline. No performance change is observed. Swift SVN r19194
This commit is contained in:
@@ -137,10 +137,9 @@ extension String {
|
||||
(other._base.elementShift != 1) |
|
||||
(!self._base.hasContiguousStorage) |
|
||||
(!other._base.hasContiguousStorage)) {
|
||||
// We wrap this function with a closure to disable inlining.
|
||||
// This is a cold path and inlining _compareUnicode may
|
||||
// prevent the inlining of the compare function.
|
||||
return {$0._compareUnicode($1)}(self, other)
|
||||
return _compareUnicode(other)
|
||||
}
|
||||
|
||||
while true {
|
||||
@@ -157,8 +156,7 @@ extension String {
|
||||
if _slowPath((e1 >= 0xD800) | (e2 >= 0xD800)) {
|
||||
// Use slow unicode comparator if
|
||||
// we found multi-byte scalar.
|
||||
// Disable inlining by wrapping the callee in a closure.
|
||||
return {$0._compareUnicode($1)}(self, other)
|
||||
return _compareUnicode(other)
|
||||
}
|
||||
|
||||
if e1 < e2 {
|
||||
@@ -180,6 +178,7 @@ extension String {
|
||||
}
|
||||
}
|
||||
|
||||
@noinline
|
||||
func _compareUnicode(other : UnicodeScalarView) -> Int {
|
||||
var g1 = self.generate()
|
||||
var g2 = other.generate()
|
||||
|
||||
Reference in New Issue
Block a user