mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Micro-optimize PotentialBindings
PotentialBindings is part of ConstraintGraphNode and there's no need to store the ConstraintSystem and TypeVariableType twice. Also it doesn't need to be optional either, because we no longer need to reset and recompute bindings.
This commit is contained in:
@@ -84,7 +84,10 @@ public:
|
||||
/// as this type variable.
|
||||
ArrayRef<TypeVariableType *> getEquivalenceClass() const;
|
||||
|
||||
inference::PotentialBindings &getCurrentBindings();
|
||||
inference::PotentialBindings &getCurrentBindings() {
|
||||
assert(forRepresentativeVar());
|
||||
return Bindings;
|
||||
}
|
||||
|
||||
private:
|
||||
/// Determines whether the type variable associated with this node
|
||||
@@ -180,7 +183,7 @@ private:
|
||||
TypeVariableType *TypeVar;
|
||||
|
||||
/// The set of bindings associated with this type variable.
|
||||
std::optional<inference::PotentialBindings> Bindings;
|
||||
inference::PotentialBindings Bindings;
|
||||
|
||||
/// The vector of constraints that mention this type variable, in a stable
|
||||
/// order for iteration.
|
||||
|
||||
Reference in New Issue
Block a user