Commit aca27c21 authored by Aleksey Kontsevich's avatar Aleksey Kontsevich

Optimize if-statement in selectVertex() method

parent 14f411da
...@@ -632,7 +632,7 @@ void QGCMapPolygon::selectVertex(int index) ...@@ -632,7 +632,7 @@ void QGCMapPolygon::selectVertex(int index)
{ {
if(index == _selectedVertexIndex) return; // do nothing if(index == _selectedVertexIndex) return; // do nothing
if((0 <= index && index < count()) || index == -1) { if(-1 <= index && index < count()) {
_selectedVertexIndex = index; _selectedVertexIndex = index;
} else { } else {
qWarning() << "QGCMapPolygon: Selected vertex index is out of bounds!"; qWarning() << "QGCMapPolygon: Selected vertex index is out of bounds!";
......
...@@ -449,7 +449,7 @@ void QGCMapPolyline::selectVertex(int index) ...@@ -449,7 +449,7 @@ void QGCMapPolyline::selectVertex(int index)
{ {
if(index == _selectedVertexIndex) return; // do nothing if(index == _selectedVertexIndex) return; // do nothing
if((0 <= index && index < count()) || index == -1) { if(-1 <= index && index < count()) {
_selectedVertexIndex = index; _selectedVertexIndex = index;
} else { } else {
qWarning() << "QGCMapPolyline: Selected vertex index is out of bounds!"; qWarning() << "QGCMapPolyline: Selected vertex index is out of bounds!";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment