RestoreStateAndUnlock was only called with control_adjacent=true. Remove the parameter and unconditionally call the function that was gated behind it being true.
std::copy
std::copy_n
std::find_if
std::ranges::find