Fix all - 2 cppcheck performance hints

This commit is contained in:
heckflosse
2016-07-06 13:04:24 +02:00
parent a991d53bf3
commit c8779c04f5
43 changed files with 114 additions and 146 deletions

View File

@@ -158,7 +158,7 @@ void ffInfo::updateRawImage()
int nFiles = 1; // First file data already loaded
for( iName++; iName != pathNames.end(); iName++) {
for( ++iName; iName != pathNames.end(); ++iName) {
RawImage* temp = new RawImage(*iName);
if( !temp->loadRaw(true)) {
@@ -268,7 +268,7 @@ void FFManager::init( Glib::ustring pathname )
}
// Where multiple shots exist for same group, move filename to list
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) {
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) {
ffInfo &i = iter->second;
if( !i.pathNames.empty() && !i.pathname.empty() ) {
@@ -282,7 +282,7 @@ void FFManager::init( Glib::ustring pathname )
} else {
printf( "%s: MEAN of \n ", i.key().c_str());
for( std::list<Glib::ustring>::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); iter++ ) {
for( std::list<Glib::ustring>::iterator iter = i.pathNames.begin(); iter != i.pathNames.end(); ++iter ) {
printf( "%s, ", iter->c_str() );
}
@@ -361,7 +361,7 @@ ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool)
iter = ffList.insert(std::pair< std::string, ffInfo>( key, n ) );
} else {
while( iter != ffList.end() && iter->second.key() == key && ABS(iter->second.timestamp - ri.get_timestamp()) > 60 * 60 * 6 ) { // 6 hour difference
iter++;
++iter;
}
if( iter != ffList.end() ) {
@@ -384,7 +384,7 @@ void FFManager::getStat( int &totFiles, int &totTemplates)
totFiles = 0;
totTemplates = 0;
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) {
for( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) {
ffInfo &i = iter->second;
if( i.pathname.empty() ) {
@@ -413,7 +413,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, const s
ffList_t::iterator bestMatch = iter;
time_t bestDeltaTime = ABS(iter->second.timestamp - t);
for(iter++; iter != ffList.end() && !key.compare( iter->second.key() ); iter++ ) {
for(++iter; iter != ffList.end() && !key.compare( iter->second.key() ); ++iter ) {
time_t d = ABS(iter->second.timestamp - t );
if( d < bestDeltaTime ) {
@@ -428,7 +428,7 @@ ffInfo* FFManager::find( const std::string &mak, const std::string &mod, const s
ffList_t::iterator bestMatch = iter;
double bestD = iter->second.distance( mak, mod, len, focal, apert );
for( iter++; iter != ffList.end(); iter++ ) {
for( ++iter; iter != ffList.end(); ++iter ) {
double d = iter->second.distance( mak, mod, len, focal, apert );
if( d < bestD ) {
@@ -454,7 +454,7 @@ RawImage* FFManager::searchFlatField( const std::string &mak, const std::string
RawImage* FFManager::searchFlatField( const Glib::ustring filename )
{
for ( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); iter++ ) {
for ( ffList_t::iterator iter = ffList.begin(); iter != ffList.end(); ++iter ) {
if( iter->second.pathname.compare( filename ) == 0 ) {
return iter->second.getRawImage();
}