kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #31307
[PATCH 11/12] Remove some else-after-return's
---
common/class_undoredo_container.cpp | 37 +++++++++++++++++++------------------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/common/class_undoredo_container.cpp b/common/class_undoredo_container.cpp
index 88eec3001..e3f974eb3 100644
--- a/common/class_undoredo_container.cpp
+++ b/common/class_undoredo_container.cpp
@@ -178,8 +178,8 @@ EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx ) const
{
if( aIdx < m_ItemsList.size() )
return m_ItemsList[aIdx].GetItem();
- else
- return NULL;
+
+ return NULL;
}
@@ -187,8 +187,8 @@ EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItemLink( unsigned int aIdx ) const
{
if( aIdx < m_ItemsList.size() )
return m_ItemsList[aIdx].GetLink();
- else
- return NULL;
+
+ return NULL;
}
@@ -196,8 +196,8 @@ UNDO_REDO_T PICKED_ITEMS_LIST::GetPickedItemStatus( unsigned int aIdx ) const
{
if( aIdx < m_ItemsList.size() )
return m_ItemsList[aIdx].GetStatus();
- else
- return UR_UNSPECIFIED;
+
+ return UR_UNSPECIFIED;
}
@@ -205,8 +205,8 @@ STATUS_FLAGS PICKED_ITEMS_LIST::GetPickerFlags( unsigned aIdx ) const
{
if( aIdx < m_ItemsList.size() )
return m_ItemsList[aIdx].GetFlags();
- else
- return 0;
+
+ return 0;
}
@@ -217,8 +217,8 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, unsigned aIdx )
m_ItemsList[aIdx].SetItem( aItem );
return true;
}
- else
- return false;
+
+ return false;
}
@@ -229,8 +229,8 @@ bool PICKED_ITEMS_LIST::SetPickedItemLink( EDA_ITEM* aLink, unsigned aIdx )
m_ItemsList[aIdx].SetLink( aLink );
return true;
}
- else
- return false;
+
+ return false;
}
@@ -242,8 +242,8 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, UNDO_REDO_T aStatus, uns
m_ItemsList[aIdx].SetStatus( aStatus );
return true;
}
- else
- return false;
+
+ return false;
}
@@ -254,8 +254,8 @@ bool PICKED_ITEMS_LIST::SetPickedItemStatus( UNDO_REDO_T aStatus, unsigned aIdx
m_ItemsList[aIdx].SetStatus( aStatus );
return true;
}
- else
- return false;
+
+ return false;
}
@@ -266,8 +266,8 @@ bool PICKED_ITEMS_LIST::SetPickerFlags( STATUS_FLAGS aFlags, unsigned aIdx )
m_ItemsList[aIdx].SetFlags( aFlags );
return true;
}
- else
- return false;
+
+ return false;
}
@@ -275,6 +275,7 @@ bool PICKED_ITEMS_LIST::RemovePicker( unsigned aIdx )
{
if( aIdx >= m_ItemsList.size() )
return false;
+
m_ItemsList.erase( m_ItemsList.begin() + aIdx );
return true;
}
--
2.14.1
References