Skip to content

Commit 5b085fe

Browse files
committed
Don't use #if DEBUG
1 parent 0416c03 commit 5b085fe

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

stdlib/public/core/UnicodeScalar.swift

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ extension UInt64 {
382382

383383
/// Extends `UInt8` providing initialization from a Unicode scalar.
384384
extension UInt8 {
385-
/// Converts a UInt8 value into a UnicodeScalar
385+
/// Converts a UInt8 ASCII value into a UnicodeScalar
386386
@_transparent @_alwaysEmitIntoClient
387-
var ascii: Unicode.Scalar? {
387+
var asciiScalar: Unicode.Scalar? {
388388
guard self < 0x80 else { return nil }
389389
return Unicode.Scalar(self)
390390
}
@@ -409,31 +409,19 @@ extension UInt8 {
409409
/// - Returns: `true` when the `UInt8` is equal to the provided Unicode scalar; otherwise, `false`.
410410
@_transparent @_alwaysEmitIntoClient
411411
public static func == (i: Self, s: Unicode.Scalar) -> Bool {
412-
#if DEBUG
413-
return i == UInt8(ascii: s)
414-
#else
415412
return i == UInt8(ifASCII: s)
416-
#endif
417413
}
418414

419415
/// Returns a Boolean indicating whether the `UInt8` is not equal to the provided Unicode scalar.
420416
@_transparent @_alwaysEmitIntoClient
421417
public static func != (i: Self, s: Unicode.Scalar) -> Bool {
422-
#if DEBUG
423-
return i != UInt8(ascii: s)
424-
#else
425418
return i != UInt8(ifASCII: s)
426-
#endif
427419
}
428420

429421
/// Enables pattern matching of Unicode scalars in switch statements.
430422
@_transparent @_alwaysEmitIntoClient
431423
public static func ~= (s: Unicode.Scalar, i: Self) -> Bool {
432-
#if DEBUG
433-
return i == UInt8(ascii: s)
434-
#else
435424
return i == UInt8(ifASCII: s)
436-
#endif
437425
}
438426
}
439427

@@ -447,31 +435,19 @@ extension UInt8? {
447435
/// - Returns: `true` if the optional `UInt8` is equal to the provided Unicode scalar; otherwise, `false`.
448436
@_transparent @_alwaysEmitIntoClient
449437
public static func == (i: Self, s: Unicode.Scalar) -> Bool {
450-
#if DEBUG
451-
return i == UInt8(ascii: s)
452-
#else
453438
return i == UInt8(ifASCII: s)
454-
#endif
455439
}
456440

457441
/// Returns a Boolean value indicating whether the optional `UInt8` is not equal to the provided Unicode scalar.
458442
@_transparent @_alwaysEmitIntoClient
459443
public static func != (i: Self, s: Unicode.Scalar) -> Bool {
460-
#if DEBUG
461-
return i != UInt8(ascii: s)
462-
#else
463444
return i != UInt8(ifASCII: s)
464-
#endif
465445
}
466446

467447
/// Allows pattern matching of Unicode scalars in switch statements.
468448
@_transparent @_alwaysEmitIntoClient
469449
public static func ~= (s: Unicode.Scalar, i: Self) -> Bool {
470-
#if DEBUG
471-
return i == UInt8(ascii: s)
472-
#else
473450
return i == UInt8(ifASCII: s)
474-
#endif
475451
}
476452
}
477453

0 commit comments

Comments
 (0)