Skip to content

Commit 8c5d012

Browse files
committed
Merge pull request #1774 from apple/use-truncatingBitPattern
stdlib: Use UInt8(truncatingBitPattern:) instead of an equivalent inline construct
2 parents 168e7e4 + 2c53727 commit 8c5d012

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/StringCore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ extension _StringCore : RangeReplaceableCollection {
627627
if _fastPath(elementWidth == 1) {
628628
var dst = rangeStart
629629
for u in newElements {
630-
dst.pointee = UInt8(u & 0xFF)
630+
dst.pointee = UInt8(truncatingBitPattern: u)
631631
dst += 1
632632
}
633633
}

0 commit comments

Comments
 (0)