Advertisement
PVS-StudioWarnings

PVS-Studio warning V581 for MongoDB

Nov 27th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. string _server;
  2.  
  3. bool operator<( const ServerAndQuery& other ) const {
  4.   if ( ! _orderObject.isEmpty() )
  5.     return _orderObject.woCompare( other._orderObject ) < 0;
  6.  
  7.   if ( _server < other._server )
  8.     return true;
  9.   if ( other._server > _server )
  10.     return false;
  11.   return _extra.woCompare( other._extra ) < 0;
  12. }
  13.  
  14. "A<B" is the same as "B>A".
  15.  
  16. This suspicious code was found in MongoDB project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 44, 46. parallel.h 46
  19.  
  20. 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