Remove an unnecessary const_cast.