Commit 2941838
authored
Refactor Sabre state into separately mutable components (#14909)
* Refactor Sabre state into separately mutable components
This commit separates out the three logical components of the Sabre
routing tracking into three separate structs, where each struct groups
objects that have the same mutation tendency.
The previous Sabre state stored its problem description, internal
tracking, and output tracking altogether in the same flat structure.
Those three components have different tendencies to mutate: the problem
description never mutates, the internal tracking frequently does, and
the output tracking only occasionally does and has a lifetime validity
tied to that of the problem description.
Putting them together made it impossible to call methods that mutated
the state while passing an object that borrowed from the problem
description, such as when recursing into control-flow operations,
because the borrow checker could not validate it. This applied
interface pressure to inline more into the same method, which made
code-reuse of separate concerns harder.
* Add more documentation on new structs
* Revert release-valve mechanism1 parent 9c6baac commit 2941838
1 file changed
Lines changed: 159 additions & 129 deletions
0 commit comments