DEV: removes unecessary casting (PR #9982)

GitHub