Skip to content

Commit

Permalink
Fix a few recently introduced code smells (#9161)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-derevenetz authored Oct 3, 2024
1 parent c9b8a25 commit e4d531b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fheroes2/world/world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1408,19 +1408,19 @@ OStreamBase & operator<<( OStreamBase & stream, const MapObjects & objs )
for ( const auto & [uid, obj] : objectsRef ) {
assert( obj && obj->GetUID() == uid );

if ( auto * objPtr = dynamic_cast<MapEvent *>( obj.get() ); objPtr != nullptr ) {
if ( const auto * objPtr = dynamic_cast<const MapEvent *>( obj.get() ); objPtr != nullptr ) {
stream << uid << MP2::OBJ_EVENT << *objPtr;

continue;
}

if ( auto * objPtr = dynamic_cast<MapSphinx *>( obj.get() ); objPtr != nullptr ) {
if ( const auto * objPtr = dynamic_cast<const MapSphinx *>( obj.get() ); objPtr != nullptr ) {
stream << uid << MP2::OBJ_SPHINX << *objPtr;

continue;
}

if ( auto * objPtr = dynamic_cast<MapSign *>( obj.get() ); objPtr != nullptr ) {
if ( const auto * objPtr = dynamic_cast<const MapSign *>( obj.get() ); objPtr != nullptr ) {
stream << uid << MP2::OBJ_SIGN << *objPtr;

continue;
Expand Down

0 comments on commit e4d531b

Please sign in to comment.