File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -790,10 +790,8 @@ extension _GraphemeBreakingState {
790
790
// we continue being in one and may check if this extend is a Virama.
791
791
if self . isInIndicSequence || scalar1. _isLinkingConsonant {
792
792
if y == . extend {
793
- let extendNormData = Unicode . _NormData ( scalar2, fastUpperbound: 0x300 )
794
-
795
793
// If our extend's CCC is 0, then this rule does not apply.
796
- guard extendNormData . ccc != 0 else {
794
+ guard scalar2 . properties . canonicalCombiningClass != . notReordered else {
797
795
return false
798
796
}
799
797
}
@@ -931,12 +929,9 @@ extension _StringGuts {
931
929
// GB9c
932
930
switch ( x, scalar2. _isLinkingConsonant) {
933
931
case ( . extend, true ) :
934
- let extendNormData = Unicode . _NormData ( scalar1, fastUpperbound: 0x300 )
935
-
936
- guard extendNormData. ccc != 0 else {
932
+ guard scalar1. properties. canonicalCombiningClass != . notReordered else {
937
933
return true
938
934
}
939
-
940
935
return !checkIfInIndicSequence( at: index, with: previousScalar)
941
936
942
937
case ( . zwj, true ) :
@@ -1055,9 +1050,7 @@ extension _StringGuts {
1055
1050
1056
1051
switch ( gbp, scalar. _isLinkingConsonant) {
1057
1052
case ( . extend, false ) :
1058
- let extendNormData = Unicode . _NormData ( scalar, fastUpperbound: 0x300 )
1059
-
1060
- guard extendNormData. ccc != 0 else {
1053
+ guard scalar. properties. canonicalCombiningClass != . notReordered else {
1061
1054
return false
1062
1055
}
1063
1056
Original file line number Diff line number Diff line change @@ -1427,8 +1427,7 @@ extension Unicode.Scalar.Properties {
1427
1427
/// This property corresponds to the "Canonical_Combining_Class" property in
1428
1428
/// the [Unicode Standard](http://www.unicode.org/versions/latest/).
1429
1429
public var canonicalCombiningClass : Unicode . CanonicalCombiningClass {
1430
- let normData = Unicode . _NormData ( _scalar)
1431
- return Unicode . CanonicalCombiningClass ( rawValue: normData. ccc)
1430
+ Unicode . _NormData ( _scalar, fastUpperbound: 0x300 ) . canonicalCombiningClass
1432
1431
}
1433
1432
}
1434
1433
You can’t perform that action at this time.
0 commit comments