@@ -34,23 +34,24 @@ extension Processor {
34
34
isStrictASCII: Bool ,
35
35
isScalarSemantics: Bool
36
36
) -> Input . Index ? {
37
- switch _quickMatchBuiltinCC (
37
+ if case . definite ( let result ) = _quickMatchBuiltinCC (
38
38
cc,
39
39
isInverted: isInverted,
40
40
isStrictASCII: isStrictASCII,
41
41
isScalarSemantics: isScalarSemantics
42
42
) {
43
- case . no:
44
- return nil
45
- case . yes( let next) :
46
- return next
47
- case . maybe:
48
- return _slowMatchBuiltinCC (
49
- cc,
50
- isInverted: isInverted,
51
- isStrictASCII: isStrictASCII,
52
- isScalarSemantics: isScalarSemantics)
43
+ assert ( result == _thoroughMatchBuiltinCC (
44
+ cc,
45
+ isInverted: isInverted,
46
+ isStrictASCII: isStrictASCII,
47
+ isScalarSemantics: isScalarSemantics) )
48
+ return result
53
49
}
50
+ return _thoroughMatchBuiltinCC (
51
+ cc,
52
+ isInverted: isInverted,
53
+ isStrictASCII: isStrictASCII,
54
+ isScalarSemantics: isScalarSemantics)
54
55
}
55
56
56
57
@inline ( __always)
@@ -59,23 +60,17 @@ extension Processor {
59
60
isInverted: Bool ,
60
61
isStrictASCII: Bool ,
61
62
isScalarSemantics: Bool
62
- ) -> QuickResult < Input . Index > {
63
+ ) -> QuickResult < Input . Index ? > {
63
64
guard let ( next, result) = input. _quickMatch (
64
65
cc, at: currentPosition, isScalarSemantics: isScalarSemantics
65
66
) else {
66
- return . maybe
67
+ return . unknown
67
68
}
68
- let idx = result == isInverted ? nil : next
69
- assert ( idx == _slowMatchBuiltinCC (
70
- cc,
71
- isInverted: isInverted,
72
- isStrictASCII: isStrictASCII,
73
- isScalarSemantics: isScalarSemantics) )
74
- return . definite( idx)
69
+ return . definite( result == isInverted ? nil : next)
75
70
}
76
71
77
72
@inline ( never)
78
- func _slowMatchBuiltinCC (
73
+ func _thoroughMatchBuiltinCC (
79
74
_ cc: _CharacterClassModel . Representation ,
80
75
isInverted: Bool ,
81
76
isStrictASCII: Bool ,
0 commit comments