__wt_conn_dhandle_close decides what happens to a tree's pages through three interdependent booleans – discard, marked_dead, is_mapped – assigned across a ~50-line block where each branch depends on what earlier branches already set, then re-tested at four points further down. Nobody can tell which combination of inputs leads to which outcome without replaying the whole assignment order, which makes the function risky to change and hard to review.
The fix for the ticket replaces the derived booleans with a single explicit action value covering every combination of the five inputs, and pins all of them in a test so a later restructuring cannot silently move a case from one outcome to another.
Behaviour stays as it is, apart from rejecting combinations that cannot occur. That leaves the function safe to split up, rename, and simplify in follow-up work.