@@ -4410,12 +4410,12 @@ struct AsyncHandlerParamDesc : public AsyncHandlerDesc {
4410
4410
}
4411
4411
};
4412
4412
4413
- enum class ConditionType { INVALID, NIL, NOT_NIL };
4413
+ enum class ConditionType { NIL, NOT_NIL };
4414
4414
4415
4415
// / Finds the `Subject` being compared to in various conditions. Also finds any
4416
4416
// / pattern that may have a bound name.
4417
4417
struct CallbackCondition {
4418
- ConditionType Type = ConditionType::INVALID ;
4418
+ Optional< ConditionType> Type;
4419
4419
const Decl *Subject = nullptr ;
4420
4420
const Pattern *BindPattern = nullptr ;
4421
4421
// Bit of a hack. When the `Subject` is a `Result` type we use this to
@@ -4487,7 +4487,7 @@ struct CallbackCondition {
4487
4487
}
4488
4488
}
4489
4489
4490
- bool isValid () const { return Type != ConditionType::INVALID ; }
4490
+ bool isValid () const { return Type. hasValue () ; }
4491
4491
4492
4492
// / Given an `if` condition `Cond` and a set of `Decls`, find any
4493
4493
// / `CallbackCondition`s in `Cond` that use one of those `Decls` and add them
@@ -4886,10 +4886,10 @@ struct CallbackClassifier {
4886
4886
ThenBlock = ElseBlock;
4887
4887
ElseBlock = TempBlock;
4888
4888
} else {
4889
- ConditionType CondType = ConditionType::INVALID ;
4889
+ Optional< ConditionType> CondType;
4890
4890
for (auto &Entry : CallbackConditions) {
4891
4891
if (IsResultParam || Entry.second .Subject != ErrParam) {
4892
- if (CondType == ConditionType::INVALID ) {
4892
+ if (! CondType) {
4893
4893
CondType = Entry.second .Type ;
4894
4894
} else if (CondType != Entry.second .Type ) {
4895
4895
// Similar to the unknown conditions case. Add the whole if unless
0 commit comments