Fix logically dead code identified by Coverity

This commit is contained in:
Nyall Dawson 2017-02-06 10:16:44 +10:00
parent a80cca0fb3
commit 737c92ddbb
2 changed files with 46 additions and 57 deletions

View File

@ -635,8 +635,6 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
return false;
}
if ( result != DRW::BAD_NONE )
{
switch ( result )
{
case DRW::BAD_NONE:
@ -681,9 +679,9 @@ bool QgsDwgImporter::import( const QString &drawing, QString &error, bool doExpa
break;
}
QgsDebugMsg( QString( "error:%1" ).arg( error ) );
if ( result != DRW::BAD_NONE )
{
QgsDebugMsg( QString( "error:%1" ).arg( error ) );
return false;
}
@ -2553,7 +2551,7 @@ bool QgsDwgImporter::expandInserts( QString &error )
OGRFeatureH insert = nullptr;
int i = 0, errors = 0;
for ( int i = 0, errors = 0; true; ++i )
for ( int i = 0; true; ++i )
{
if ( i % 1000 == 0 )
{
@ -2731,18 +2729,12 @@ bool QgsDwgImporter::expandInserts( QString &error )
++j;
}
if ( f )
OGR_F_Destroy( f );
OGR_DS_ReleaseResultSet( mDs, src );
QgsDebugMsgLevel( QString( "%1: %2 features copied" ).arg( name ).arg( j ), 5 );
}
}
if ( insert )
OGR_F_Destroy( insert );
if ( errors > 0 )
{
error = QObject::tr( "%1 write errors during block expansion" ).arg( errors );

View File

@ -485,9 +485,6 @@ namespace QgsWfs
respElem.appendChild( trElem );
return resp;
return doc;
}
namespace