summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-09-03 16:09:47 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-09-03 16:09:47 (GMT)
commita3891570eb191c9ceccb53a8630be178979447f9 (patch)
tree53fd7b8ec55004fbcdae8a08b59bc88d20e74a9e
parentdf015efc2e70b80d23bcad683d7f819904009af4 (diff)
Simplify
-rw-r--r--tools/osm-simplify/NodeReducer.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/osm-simplify/NodeReducer.h b/tools/osm-simplify/NodeReducer.h
index 3064dec..e67b209 100644
--- a/tools/osm-simplify/NodeReducer.h
+++ b/tools/osm-simplify/NodeReducer.h
@@ -24,16 +24,12 @@ private:
template<class T>
T* reduce(T* lineString)
{
- qint64 prevSize = lineString->size();
-
- T* reducedLine;
+ qint64 const prevSize = lineString->size();
if (prevSize < 2) {
- reducedLine = new T(*lineString);
- return reducedLine;
- } else {
- reducedLine = new T;
+ return new T(*lineString);
}
+ T* reducedLine = new T;
QVector<GeoDataCoordinates>::iterator itCoords = lineString->begin();
GeoDataCoordinates currentCoords = *itCoords;
reducedLine->append(*itCoords);