From 4847fe168ea90e0e76e8ca5a25e1f54c5e055287 Mon Sep 17 00:00:00 2001 From: Douglas Creager Date: Mon, 15 Dec 2025 13:51:46 -0500 Subject: [PATCH] add TODO about lazy source_order adjustment --- crates/ty_python_semantic/src/types/constraints.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ty_python_semantic/src/types/constraints.rs b/crates/ty_python_semantic/src/types/constraints.rs index c1e7525a33..82d6c3b0ad 100644 --- a/crates/ty_python_semantic/src/types/constraints.rs +++ b/crates/ty_python_semantic/src/types/constraints.rs @@ -1085,6 +1085,11 @@ impl<'db> Node<'db> { fn or_with_offset(self, db: &'db dyn Db, other: Self) -> Self { // To ensure that `self` appears before `other` in `source_order`, we add the maximum // `source_order` of the lhs to all of the `source_order`s in the rhs. + // + // TODO: If we store `other_offset` as a new field on InteriorNode, we might be able to + // avoid all of the extra work in the calls to with_adjusted_source_order, and apply the + // adjustment lazily when walking a BDD tree. (ditto below in the other _with_offset + // methods) let other_offset = self.max_source_order(db); self.or_inner(db, other, other_offset) }