PVS-StudioWarnings

PVS-Studio warning V523 for Skia

Nov 20th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. void SkOpEdgeBuilder::closeContour(const SkPoint& curveEnd,
  2.                                    const SkPoint& curveStart)
  3. {
  4.   ....
  5.   if (curveEnd.fX != curveStart.fX ||
  6.       curveEnd.fY != curveStart.fY)
  7.   {
  8.     fPathPts[fPathPts.count() - 1] = curveStart;
  9.   } else {
  10.     fPathPts[fPathPts.count() - 1] = curveStart;
  11.   }  ....
  12. }
  13.  
  14. This suspicious code was found in Skia project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V523 The 'then' statement is equivalent to the 'else' statement. skopedgebuilder.cpp 52
  17.  
  18. 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