From 2580137d7c69ba5752ca7ce698d6cf104ff7f00c Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 22:57:37 +0200 Subject: fix small "performance" issues (cppcheck) (bzr r12461) --- src/livarot/PathConversion.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'src/livarot/PathConversion.cpp') diff --git a/src/livarot/PathConversion.cpp b/src/livarot/PathConversion.cpp index ed5f03f80..8d36dca4c 100644 --- a/src/livarot/PathConversion.cpp +++ b/src/livarot/PathConversion.cpp @@ -119,15 +119,12 @@ void Path::ConvertWithBackData(double treshhold) if ( nbInterm >= 1 ) { Geom::Point bx = curX; - Geom::Point cx = curX; - Geom::Point dx = curX; + Geom::Point dx = nData->p; + Geom::Point cx = 2 * bx - dx; - dx = nData->p; ip++; nData = dynamic_cast(descr_cmd[ip]); - cx = 2 * bx - dx; - for (int k = 0; k < nbInterm - 1; k++) { bx = cx; cx = dx; @@ -323,15 +320,12 @@ void Path::Convert(double treshhold) RecBezierTo(midX, curX, nextX, treshhold, 8); } else if ( nbInterm > 1 ) { Geom::Point bx = curX; - Geom::Point cx = curX; - Geom::Point dx = curX; + Geom::Point dx = nData->p; + Geom::Point cx = 2 * bx - dx; - dx = nData->p; ip++; nData = dynamic_cast(descr_cmd[ip]); - cx = 2 * bx - dx; - for (int k = 0; k < nbInterm - 1; k++) { bx = cx; cx = dx; @@ -565,15 +559,12 @@ void Path::ConvertEvenLines(double treshhold) RecBezierTo(midX, curX, nextX, treshhold, 8, 4 * treshhold); } else if ( nbInterm > 1 ) { Geom::Point bx = curX; - Geom::Point cx = curX; - Geom::Point dx = curX; + Geom::Point dx = nData->p; + Geom::Point cx = 2 * bx - dx; - dx = nData->p; ip++; nData = dynamic_cast(descr_cmd[ip]); - cx = 2 * bx - dx; - for (int k = 0; k < nbInterm - 1; k++) { bx = cx; cx = dx; -- cgit v1.2.3