Advertisement
PVS-StudioWarnings

PVS-Studio warning V801 for Ultimate ToolBox

Nov 21st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. BOOL operator==(const _tagMODULEINFO mi) const
  2. {
  3.  return ((hModule==mi.hModule)&
  4.    (sModuleFileName.CompareNoCase(mi.sModuleFileName)==0));
  5. }
  6.  
  7. This code doesn't contain errors, but it can be made more efficient. There's no need in creating a copy of the _tagMODULEINFO structure each time when calling the '==' operator. The V801 message points out that "const _tagMODULEINFO mi" can be replaced with "const _tagMODULEINFO &mi".
  8.  
  9. This suspicious code was found in Ultimate ToolBox project by PVS-Studio static code analyzer.
  10. Warning message is:
  11. V801 Decreased performance. It is better to redefine the first function argument as a reference. Consider replacing 'const .. mi' with 'const .. &mi'. UT oxdllmanager.h 123
  12.  
  13. 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