Problem 1418

Summary: There are identical sub-expressions 'participants[i]->GetDefinition()' to the left and to the right of the '!=' operator. g4qmdgroundstatenucleus.cc 473
Product: Geant4 Reporter: a.ramazani
Component: processes/hadronic/models/qmdAssignee: tkoi
Status: RESOLVED FIXED    
Severity: normal CC: a.ramazani
Priority: P5    
Version: 9.6   
Hardware: PC   
OS: Windows   

Description a.ramazani 2012-12-31 13:15:39 CET
There are identical sub-expressions 'participants[i]->GetDefinition()' to the left and to the right of the '!=' operator. g4qmdgroundstatenucleus.cc 473

Error:
         if ( participants[i]->GetDefinition() != participants[i]->GetDefinition() )


Correct:
         if ( participants[i]->GetDefinition() != participants[j]->GetDefinition() )

I used The Best C++ static code analysis Tools "PVS-Studio 4.77" under Visual Studio 2012 to analyze the Geant4.9.6 code
There is many warnings and performance optimization so I recommend using PVS-Studio 
http://files.viva64.com/beta/PVS-Studio_setup.exe

Please correct me if I am wrong 
Thanks in Advance.
Comment 1 Gabriele Cosmo 2013-01-11 18:04:59 CET
Thanks for reporting this. The fix is now in the development trunk and will be made available in the next patch release.