Skip to content

Commit 5a577a8

Browse files
committed
[stdlib] Don’t force-inline Character.== and .<
The code to compare character values can be huge; it doesn’t seem a good idea to forcibly inline it. The @inline(__always) here can make specialized Set<Character> operations balloon 10x their current size with unrelated modifications in Set. The code size bloat doesn’t always happen; I *guess* that _fastPaths inside String.== cause unintuitive inlining decisions in callers.
1 parent 73589ec commit 5a577a8

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

stdlib/public/core/Character.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,6 @@ internal var _minASCIICharReprBuiltin: Builtin.Int63 {
448448

449449
extension Character : Equatable {
450450
@inlinable
451-
@inline(__always)
452451
public static func == (lhs: Character, rhs: Character) -> Bool {
453452
let l0 = lhs._smallUTF16
454453
if _fastPath(l0 != nil), let l = l0?._storage {
@@ -467,7 +466,6 @@ extension Character : Equatable {
467466

468467
extension Character : Comparable {
469468
@inlinable
470-
@inline(__always)
471469
public static func < (lhs: Character, rhs: Character) -> Bool {
472470
let l0 = lhs._smallUTF16
473471
if _fastPath(l0 != nil), let l = l0?._storage {

0 commit comments

Comments
 (0)