GameListCtrl: eliminate redundant elses
These aren't necessary considering the above condition returns
This commit is contained in:
parent
6e0e4646bd
commit
d8e4d5f035
|
@ -715,8 +715,8 @@ const GameListItem* CGameListCtrl::GetISO(size_t index) const
|
||||||
{
|
{
|
||||||
if (index < m_ISOFiles.size())
|
if (index < m_ISOFiles.size())
|
||||||
return m_ISOFiles[index].get();
|
return m_ISOFiles[index].get();
|
||||||
else
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CGameListCtrl* caller;
|
static CGameListCtrl* caller;
|
||||||
|
@ -983,21 +983,17 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
|
||||||
|
|
||||||
const GameListItem* CGameListCtrl::GetSelectedISO() const
|
const GameListItem* CGameListCtrl::GetSelectedISO() const
|
||||||
{
|
{
|
||||||
if (m_ISOFiles.size() == 0)
|
if (m_ISOFiles.empty())
|
||||||
{
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
|
||||||
else if (GetSelectedItemCount() == 0)
|
if (GetSelectedItemCount() == 0)
|
||||||
{
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
|
||||||
else
|
long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||||
{
|
if (item == wxNOT_FOUND)
|
||||||
long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
return nullptr;
|
||||||
if (item == wxNOT_FOUND)
|
|
||||||
return nullptr;
|
return m_ISOFiles[GetItemData(item)].get();
|
||||||
return m_ISOFiles[GetItemData(item)].get();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<const GameListItem*> CGameListCtrl::GetAllSelectedISOs() const
|
std::vector<const GameListItem*> CGameListCtrl::GetAllSelectedISOs() const
|
||||||
|
|
Loading…
Reference in New Issue