Avoid const_cast in getResult