Advertisement
PVS-StudioWarnings

PVS-Studio warning V523 for ACE

Nov 26th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. ACE_Throughput_Stats::sample (ACE_UINT64 throughput,
  2.                               ACE_UINT64 latency)
  3. {
  4.   this->ACE_Basic_Stats::sample (latency);
  5.  
  6.   if (this->samples_count () == 1u)
  7.     {
  8.       this->throughput_last_   = throughput;
  9.     }
  10.   else
  11.     {
  12.       this->throughput_last_ = throughput;
  13.     }
  14. }
  15.  
  16. This suspicious code was found in ACE project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V523 The 'then' statement is equivalent to the 'else' statement. ACE throughput_stats.cpp 31
  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