From 232d5c9f3cda7f24f4c3019c3c312f81f8797011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Fri, 14 Mar 2014 01:20:33 -0300 Subject: Small code simplification (bzr r11950.7.1) --- src/ui/tool/path-manipulator.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 1cc075603..f8cc58e3b 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1206,11 +1206,7 @@ bool PathManipulator::isBSpline(bool recalculate){ if(recalculate){ BSplineSteps = this->BSplineGetSteps(); } - bool isBSpline = false; - if(BSplineSteps>0){ - isBSpline = true; - } - return isBSpline; + return BSplineSteps > 0; } // returns the corresponding strength to the position of a handler -- cgit v1.2.3 From ed6364b83dafb3d1b9cbedfa6675817833e9fdeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20dos=20Santos=20Oliveira?= Date: Fri, 14 Mar 2014 01:21:08 -0300 Subject: Adding default argument to PathManipulator::isBSpline. Default argument is used when function is called with missing arguments. The default was chosen to 'true', because it is the safest value in this context. From now on, the function can be called like "_pm.isBSpline()", which is more intuitive. Still, I haven't studied the code enough to determine if this cache behaviour (force the user to think if cache is correct) is appropriate. (bzr r11950.7.2) --- src/ui/tool/path-manipulator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/tool/path-manipulator.h b/src/ui/tool/path-manipulator.h index 5186bfc95..594f56ff9 100644 --- a/src/ui/tool/path-manipulator.h +++ b/src/ui/tool/path-manipulator.h @@ -106,7 +106,7 @@ private: typedef boost::shared_ptr SubpathPtr; void _createControlPointsFromGeometry(); - bool isBSpline(bool recalculate); + bool isBSpline(bool recalculate = true); double BSplineHandlePosition(Handle *h); Geom::Point BSplineHandleReposition(Handle *h); Geom::Point BSplineHandleReposition(Handle *h,double pos); -- cgit v1.2.3