Use const iterator with std::find_if where possible

Make the resulting interator const.

Change-Id: I4aadcfff35f6b1015e506bc75bcfc2a1f1be4d65
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2020-11-18 13:06:55 +01:00
parent 48c2afe157
commit b269066435
8 changed files with 17 additions and 17 deletions

View File

@@ -486,14 +486,14 @@ AndroidDeviceInfo AndroidDeviceDialog::device()
refreshDeviceList();
if (!m_defaultDevice.isEmpty()) {
auto device = std::find_if(m_connectedDevices.begin(),
m_connectedDevices.end(),
auto device = std::find_if(m_connectedDevices.cbegin(),
m_connectedDevices.cend(),
[this](const AndroidDeviceInfo &info) {
return info.serialNumber == m_defaultDevice ||
info.avdname == m_defaultDevice;
});
if (device != m_connectedDevices.end())
if (device != m_connectedDevices.cend())
return *device;
m_defaultDevice.clear();
}