Opened 10 days ago

#12055 new defect

BACKEDS: strange code in sdl-events.cpp

Reported by: fedor4ever Owned by:
Priority: normal Component: --Other--
Version: Keywords:
Cc: Game:

Description

This code present till commit 7de9982 from line 178. Code smells bad. Why used dynamic_cast? It's unsafe and lower perfomance.

if (_graphicsManager) {
		if (dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)) {
			dynamic_cast<SdlGraphics3dManager *>(_graphicsManager)->notifyMousePosition(event.mouse);
		} else if (dynamic_cast<SdlGraphicsManager *>(_graphicsManager)) {
			dynamic_cast<SdlGraphicsManager *>(_graphicsManager)->notifyMousePosition(event.mouse);
		}
}

Change History (0)

Note: See TracTickets for help on using tickets.