PVS-StudioWarnings

PVS-Studio warning V523 for UnrealEngine4

Nov 10th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. class SLATE_API FSlateStyleSet : public ISlateStyle
  2. {
  3.   ....
  4.   template< typename DefinitionType >
  5.   FORCENOINLINE void Set(....)
  6.   {
  7.     ....
  8.     if ( DefinitionPtr == NULL )
  9.     {
  10.       WidgetStyleValues.Add( PropertyName,
  11.         MakeShareable(new DefinitionType(InStyleDefintion)) );
  12.     }
  13.     else
  14.     {
  15.       WidgetStyleValues.Add( PropertyName,
  16.         MakeShareable(new DefinitionType(InStyleDefintion)) );
  17.     }
  18.   }
  19.   ....
  20. };
  21.  
  22. This suspicious code was found in UnrealEngine4 project by PVS-Studio static code analyzer.
  23. Warning message is:
  24. V523 The 'then' statement is equivalent to the 'else' statement. slatestyle.h 289
  25.  
  26. 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