This simplifies the code a bit. Pull Request: https://projects.blender.org/blender/blender/pulls/131379