PVS-StudioWarnings

PVS-Studio warning V523 for OpenMS

Nov 19th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. template <typename MapType>
  2. void MzMLHandler<MapType>::characters(
  3.   const XMLCh* const chars, const XMLSize_t)
  4. {
  5.   ....
  6.   if (optionalAttributeAsString_(data_processing_ref,
  7.                                  attributes,
  8.                                  s_data_processing_ref))
  9.   {
  10.     data_.back().meta.setDataProcessing(
  11.                         processing_[data_processing_ref]);
  12.   }
  13.   else
  14.   {
  15.     data_.back().meta.setDataProcessing(
  16.                         processing_[data_processing_ref]);
  17.   }
  18.   ....
  19. }
  20.  
  21. Most likely this is what should be written here: processing_[data_processing_ref] ... processing_[default_processing_]
  22.  
  23. This suspicious code was found in OpenMS project by PVS-Studio static code analyzer.
  24. Warning message is:
  25. V523 The 'then' statement is equivalent to the 'else' statement. mzmlhandler.h 534
  26.  
  27. 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