I'll be honest, I don't have a clue what this code is/does, but this looks like what was meant to be in 724a7350 🤷
/cc @gerddie