@@ -352,11 +352,10 @@ unsigned int ThreadExecutor::check()
352352 HANDLE *threadHandles = new HANDLE[_settings.jobs ];
353353
354354 _itNextFile = _files.begin ();
355- _itNextFileSettings = _settings.project .fileSettings .begin ();
356355
357356 _processedFiles = 0 ;
358357 _processedSize = 0 ;
359- _totalFiles = _files.size () + _settings. project . fileSettings . size () ;
358+ _totalFiles = _files.size ();
360359 _totalFileSize = 0 ;
361360 for (std::map<std::string, std::size_t >::const_iterator i = _files.begin (); i != _files.end (); ++i) {
362361 _totalFileSize += i->second ;
@@ -416,8 +415,7 @@ unsigned int __stdcall ThreadExecutor::threadProc(void *args)
416415 unsigned int result = 0 ;
417416
418417 ThreadExecutor *threadExecutor = static_cast <ThreadExecutor*>(args);
419- std::map<std::string, std::size_t >::const_iterator &itFile = threadExecutor->_itNextFile ;
420- std::list<Project::FileSettings>::const_iterator &itFileSettings = threadExecutor->_itNextFileSettings ;
418+ std::map<std::string, std::size_t >::const_iterator &it = threadExecutor->_itNextFile ;
421419
422420 // guard static members of CppCheck against concurrent access
423421 EnterCriticalSection (&threadExecutor->_fileSync );
@@ -426,32 +424,24 @@ unsigned int __stdcall ThreadExecutor::threadProc(void *args)
426424 fileChecker.settings () = threadExecutor->_settings ;
427425
428426 for (;;) {
429- if (itFile == threadExecutor->_files . end () && itFileSettings == threadExecutor-> _settings . project . fileSettings .end ()) {
427+ if (it == threadExecutor->_files .end ()) {
430428 LeaveCriticalSection (&threadExecutor->_fileSync );
431429 break ;
432- }
433430
434- std::size_t fileSize = 0 ;
435- if (itFile != threadExecutor->_files .end ()) {
436- const std::string &file = itFile->first ;
437- fileSize = itFile->second ;
438- ++itFile;
431+ }
432+ const std::string &file = it->first ;
433+ const std::size_t fileSize = it->second ;
434+ ++it;
439435
440- LeaveCriticalSection (&threadExecutor->_fileSync );
436+ LeaveCriticalSection (&threadExecutor->_fileSync );
441437
442- std::map<std::string, std::string>::const_iterator fileContent = threadExecutor->_fileContents .find (file);
443- if (fileContent != threadExecutor->_fileContents .end ()) {
444- // File content was given as a string
445- result += fileChecker.check (file, fileContent->second );
446- } else {
447- // Read file from a file
448- result += fileChecker.check (file);
449- }
450- } else { // file settings..
451- const Project::FileSettings &fs = *itFileSettings;
452- ++itFileSettings;
453- LeaveCriticalSection (&threadExecutor->_fileSync );
454- result += fileChecker.check (fs);
438+ std::map<std::string, std::string>::const_iterator fileContent = threadExecutor->_fileContents .find (file);
439+ if (fileContent != threadExecutor->_fileContents .end ()) {
440+ // File content was given as a string
441+ result += fileChecker.check (file, fileContent->second );
442+ } else {
443+ // Read file from a file
444+ result += fileChecker.check (file);
455445 }
456446
457447 EnterCriticalSection (&threadExecutor->_fileSync );
0 commit comments