Skip to content

Commit bae6f52

Browse files
committed
[stdlib] Make Character.hash(into:) explicitly not inlinable
The @inlinable attribute was left off by accident, but this turned out to be a measurable performance boost for Character hashing. Also add @effects(releasenone), for good measure.
1 parent 0342ce3 commit bae6f52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/core/Character.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ extension Character : Comparable {
477477
}
478478

479479
extension Character: Hashable {
480+
// not @inlinable (performance)
481+
@effects(releasenone)
480482
public func hash(into hasher: inout Hasher) {
481483
// FIXME(performance): constructing a temporary string is extremely
482484
// wasteful and inefficient.

0 commit comments

Comments
 (0)