File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
Sources/DiffableTextStylesXNumeric Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -78,15 +78,6 @@ extension NumericTextFormat {
7878 try parseStrategy. parse ( characters)
7979 }
8080
81- //=------------------------------------------------------------------------=
82- // MARK: Autocorrect
83- //=------------------------------------------------------------------------=
84-
85- /// The format should always round towards zero.
86- @inlinable func autocorrect( ) -> Self {
87- self . rounded ( . towardZero)
88- }
89-
9081 //=------------------------------------------------------------------------=
9182 // MARK: Transformations
9283 //=------------------------------------------------------------------------=
Original file line number Diff line number Diff line change @@ -28,9 +28,13 @@ import Foundation
2828 // MARK: Initializers
2929 //=------------------------------------------------------------------------=
3030
31- @inlinable init ( _ format: Format ) {
32- self . format = format. autocorrect ( )
33- self . scheme = self . format. scheme ( )
31+ @inlinable init ( unchecked: Format ) {
32+ self . format = unchecked
33+ self . scheme = unchecked. scheme ( )
34+ }
35+
36+ @inlinable @inline ( __always) init ( _ format: Format ) {
37+ self . init ( unchecked: format. rounded ( . towardZero) )
3438 }
3539
3640 //=------------------------------------------------------------------------=
@@ -50,7 +54,7 @@ import Foundation
5054 //=------------------------------------------------------------------------=
5155
5256 @inlinable mutating func update( _ locale: Locale ) {
53- self = Self ( format. locale ( locale) )
57+ self = Self ( unchecked : format. locale ( locale) )
5458 }
5559
5660 //=------------------------------------------------------------------------=
You can’t perform that action at this time.
0 commit comments