mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Merge pull request #12990 from tygyh/Use-contains-method
Use 'contains' method
This commit is contained in:
@ -728,7 +728,7 @@ void CodeViewWidget::AutoStep(CodeTrace::AutoStop option)
|
||||
|
||||
for (u32 i = 1; i <= 3; i++)
|
||||
{
|
||||
if (results.mem_tracked.count(address + i))
|
||||
if (results.mem_tracked.contains(address + i))
|
||||
iter++;
|
||||
else
|
||||
break;
|
||||
|
@ -125,7 +125,7 @@ void ChunkedProgressDialog::SetProgress(const int pid, const u64 progress)
|
||||
{
|
||||
QString player_name = GetPlayerNameFromPID(pid);
|
||||
|
||||
if (!m_status_labels.count(pid))
|
||||
if (!m_status_labels.contains(pid))
|
||||
return;
|
||||
|
||||
const float acquired = progress / 1024.0f / 1024.0f;
|
||||
|
@ -122,7 +122,7 @@ void GameDigestDialog::SetProgress(int pid, int progress)
|
||||
{
|
||||
QString player_name = GetPlayerNameFromPID(pid);
|
||||
|
||||
if (!m_status_labels.count(pid))
|
||||
if (!m_status_labels.contains(pid))
|
||||
return;
|
||||
|
||||
m_status_labels[pid]->setText(
|
||||
@ -134,7 +134,7 @@ void GameDigestDialog::SetResult(int pid, const std::string& result)
|
||||
{
|
||||
QString player_name = GetPlayerNameFromPID(pid);
|
||||
|
||||
if (!m_status_labels.count(pid))
|
||||
if (!m_status_labels.contains(pid))
|
||||
return;
|
||||
|
||||
m_status_labels[pid]->setText(
|
||||
|
@ -659,7 +659,7 @@ void NetPlayDialog::UpdateGUI()
|
||||
|
||||
auto* name_item = new QTableWidgetItem(QString::fromStdString(p->name));
|
||||
name_item->setToolTip(name_item->text());
|
||||
const auto& status_info = player_status.count(p->game_status) ?
|
||||
const auto& status_info = player_status.contains(p->game_status) ?
|
||||
player_status.at(p->game_status) :
|
||||
std::make_pair(QStringLiteral("?"), QStringLiteral("?"));
|
||||
auto* status_item = new QTableWidgetItem(status_info.first);
|
||||
|
@ -113,7 +113,7 @@ void USBDeviceAddToWhitelistDialog::RefreshDeviceList()
|
||||
auto whitelist = Config::GetUSBDeviceWhitelist();
|
||||
for (const auto& device : current_devices)
|
||||
{
|
||||
if (whitelist.count({device.first.first, device.first.second}) != 0)
|
||||
if (whitelist.contains({device.first.first, device.first.second}))
|
||||
continue;
|
||||
usb_inserted_devices_list->addItem(QString::fromStdString(device.second));
|
||||
}
|
||||
|
Reference in New Issue
Block a user