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)
{
if(index == _selectedVertexIndex) return; // do nothing
if((0 <= index && index < count()) || index == -1) {
if(-1 <= index && index < count()) {
_selectedVertexIndex = index;
} else {
qWarning() << "QGCMapPolygon: Selected vertex index is out of bounds!";
......
......@@ -449,7 +449,7 @@ void QGCMapPolyline::selectVertex(int index)
{
if(index == _selectedVertexIndex) return; // do nothing
if((0 <= index && index < count()) || index == -1) {
if(-1 <= index && index < count()) {
_selectedVertexIndex = index;
} else {
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