forked from qt-creator/qt-creator
TaskTree: Fix some clazy warnings
Change-Id: Ibd0931d1298489345f4055b43610f3a0747e05bc Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -20,7 +20,7 @@ TreeStorageBase::TreeStorageBase(StorageConstructor ctor, StorageDestructor dtor
|
||||
TreeStorageBase::StorageData::~StorageData()
|
||||
{
|
||||
QTC_CHECK(m_storageHash.isEmpty());
|
||||
for (void *ptr : m_storageHash)
|
||||
for (void *ptr : std::as_const(m_storageHash))
|
||||
m_destructor(ptr);
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ void TreeStorageBase::deleteStorage(int id)
|
||||
QTC_ASSERT(m_storageData->m_constructor, return); // TODO: add isValid()?
|
||||
QTC_ASSERT(m_storageData->m_destructor, return);
|
||||
QTC_ASSERT(m_storageData->m_activeStorage == 0, return); // TODO: should be allowed?
|
||||
const auto it = m_storageData->m_storageHash.find(id);
|
||||
QTC_ASSERT(it != m_storageData->m_storageHash.end(), return);
|
||||
const auto it = m_storageData->m_storageHash.constFind(id);
|
||||
QTC_ASSERT(it != m_storageData->m_storageHash.constEnd(), return);
|
||||
m_storageData->m_destructor(it.value());
|
||||
m_storageData->m_storageHash.erase(it);
|
||||
}
|
||||
|
@@ -266,7 +266,7 @@ public:
|
||||
wrapEnd(done), wrapEnd(error)}) {}
|
||||
|
||||
private:
|
||||
static TaskSetupHandler wrapSetup(SetupHandler handler) {
|
||||
static TaskSetupHandler wrapSetup(const SetupHandler &handler) {
|
||||
if (!handler)
|
||||
return {};
|
||||
return [handler](TaskInterface &taskInterface) {
|
||||
@@ -274,7 +274,7 @@ private:
|
||||
handler(*adapter.task());
|
||||
};
|
||||
};
|
||||
static TaskEndHandler wrapEnd(EndHandler handler) {
|
||||
static TaskEndHandler wrapEnd(const EndHandler &handler) {
|
||||
if (!handler)
|
||||
return {};
|
||||
return [handler](const TaskInterface &taskInterface) {
|
||||
|
Reference in New Issue
Block a user