Advertisement
PVS-StudioWarnings

PVS-Studio warning V801 for Geant4

Nov 26th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. class G4String : public std::string {
  2.   ....
  3. };
  4.  
  5. void G4NeutronHPChannel::
  6. Init(G4Element * anElement, const G4String dirName,
  7.      const G4String aFSType)
  8. {
  9.   theFSType = aFSType;
  10.   Init(anElement, dirName);
  11. }
  12.  
  13. This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V801 Decreased performance. It is better to redefine the second function argument as a reference. Consider replacing 'const .. dirName' with 'const .. &dirName'. g4neutronhpchannel.cc 55
  16.  
  17. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement