Use empty instead of size

This commit is contained in:
Filip Gawin
2019-02-12 23:47:17 +01:00
parent 363ce67459
commit 49fe9f5db1
28 changed files with 56 additions and 56 deletions

View File

@ -200,7 +200,7 @@ void IOWindow::OnDetectButtonPressed()
{
const auto list = m_option_list->findItems(expr, Qt::MatchFixedString);
if (list.size() > 0)
if (!list.empty())
m_option_list->setCurrentItem(list[0]);
}

View File

@ -223,7 +223,7 @@ void BreakpointWidget::Update()
void BreakpointWidget::OnDelete()
{
if (m_table->selectedItems().size() == 0)
if (m_table->selectedItems().empty())
return;
auto address = m_table->selectedItems()[0]->data(Qt::UserRole).toUInt();

View File

@ -232,7 +232,7 @@ void WatchWidget::ShowContextMenu()
{
QMenu* menu = new QMenu(this);
if (m_table->selectedItems().size())
if (!m_table->selectedItems().empty())
{
auto row_variant = m_table->selectedItems()[0]->data(Qt::UserRole);

View File

@ -423,7 +423,7 @@ void FIFOAnalyzer::FindPrevious()
void FIFOAnalyzer::ShowSearchResult(size_t index)
{
if (!m_search_results.size())
if (m_search_results.empty())
return;
if (index > m_search_results.size())

View File

@ -449,7 +449,7 @@ void GameList::CompressISO(bool decompress)
auto files = GetSelectedGames();
const auto game = GetSelectedGame();
if (files.size() == 0 || !game)
if (files.empty() || !game)
return;
bool wii_warning_given = false;

View File

@ -1417,7 +1417,7 @@ void MainWindow::dropEvent(QDropEvent* event)
else
{
Settings& settings = Settings::Instance();
const bool show_confirm = settings.GetPaths().size() != 0;
const bool show_confirm = !settings.GetPaths().empty();
for (const QString& folder : folders)
{

View File

@ -265,7 +265,7 @@ void NetPlaySetupDialog::accept()
else
{
auto items = m_host_games->selectedItems();
if (items.size() == 0)
if (items.empty())
{
QMessageBox::critical(this, tr("Error"), tr("You must select a game to host!"));
return;