diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index c32891e37..65aa2106f 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -203,19 +203,14 @@ namespace SDLUtil void SDLCursorManager::cursorChanged(const std::string& name) { mCurrentCursor = name; - - CursorMap::const_iterator curs_iter = mCursorMap.find(name); - - if(curs_iter != mCursorMap.end()) - { - //we have this cursor - _setGUICursor(name); - } + _setGUICursor(name); } void SDLCursorManager::_setGUICursor(const std::string &name) { - SDL_SetCursor(mCursorMap.find(name)->second); + auto it = mCursorMap.find(name); + if (it != mCursorMap.end()) + SDL_SetCursor(it->second); } void SDLCursorManager::createCursor(const std::string& name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y)