mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Fix unnecessary detatch in for loop
This commit is contained in:
parent
5450139a2e
commit
c742e545d2
1 changed files with 8 additions and 8 deletions
|
@ -79,7 +79,7 @@ std::map<std::string, mtx::events::state::power_level_t, std::less<>>
|
||||||
PowerlevelsTypeListModel::toEvents()
|
PowerlevelsTypeListModel::toEvents()
|
||||||
{
|
{
|
||||||
std::map<std::string, mtx::events::state::power_level_t, std::less<>> m;
|
std::map<std::string, mtx::events::state::power_level_t, std::less<>> m;
|
||||||
for (const auto &[key, pl] : types)
|
for (const auto &[key, pl] : qAsConst(types))
|
||||||
if (key.find('.') != std::string::npos)
|
if (key.find('.') != std::string::npos)
|
||||||
m[key] = pl;
|
m[key] = pl;
|
||||||
return m;
|
return m;
|
||||||
|
@ -87,7 +87,7 @@ PowerlevelsTypeListModel::toEvents()
|
||||||
mtx::events::state::power_level_t
|
mtx::events::state::power_level_t
|
||||||
PowerlevelsTypeListModel::kick()
|
PowerlevelsTypeListModel::kick()
|
||||||
{
|
{
|
||||||
for (const auto &[key, pl] : types)
|
for (const auto &[key, pl] : qAsConst(types))
|
||||||
if (key == "kick")
|
if (key == "kick")
|
||||||
return pl;
|
return pl;
|
||||||
return powerLevels_.users_default;
|
return powerLevels_.users_default;
|
||||||
|
@ -95,7 +95,7 @@ PowerlevelsTypeListModel::kick()
|
||||||
mtx::events::state::power_level_t
|
mtx::events::state::power_level_t
|
||||||
PowerlevelsTypeListModel::invite()
|
PowerlevelsTypeListModel::invite()
|
||||||
{
|
{
|
||||||
for (const auto &[key, pl] : types)
|
for (const auto &[key, pl] : qAsConst(types))
|
||||||
if (key == "invite")
|
if (key == "invite")
|
||||||
return pl;
|
return pl;
|
||||||
return powerLevels_.users_default;
|
return powerLevels_.users_default;
|
||||||
|
@ -103,7 +103,7 @@ PowerlevelsTypeListModel::invite()
|
||||||
mtx::events::state::power_level_t
|
mtx::events::state::power_level_t
|
||||||
PowerlevelsTypeListModel::ban()
|
PowerlevelsTypeListModel::ban()
|
||||||
{
|
{
|
||||||
for (const auto &[key, pl] : types)
|
for (const auto &[key, pl] : qAsConst(types))
|
||||||
if (key == "ban")
|
if (key == "ban")
|
||||||
return pl;
|
return pl;
|
||||||
return powerLevels_.users_default;
|
return powerLevels_.users_default;
|
||||||
|
@ -111,7 +111,7 @@ PowerlevelsTypeListModel::ban()
|
||||||
mtx::events::state::power_level_t
|
mtx::events::state::power_level_t
|
||||||
PowerlevelsTypeListModel::eventsDefault()
|
PowerlevelsTypeListModel::eventsDefault()
|
||||||
{
|
{
|
||||||
for (const auto &[key, pl] : types)
|
for (const auto &[key, pl] : qAsConst(types))
|
||||||
if (key == "zdefault_events")
|
if (key == "zdefault_events")
|
||||||
return pl;
|
return pl;
|
||||||
return powerLevels_.users_default;
|
return powerLevels_.users_default;
|
||||||
|
@ -119,7 +119,7 @@ PowerlevelsTypeListModel::eventsDefault()
|
||||||
mtx::events::state::power_level_t
|
mtx::events::state::power_level_t
|
||||||
PowerlevelsTypeListModel::stateDefault()
|
PowerlevelsTypeListModel::stateDefault()
|
||||||
{
|
{
|
||||||
for (const auto &[key, pl] : types)
|
for (const auto &[key, pl] : qAsConst(types))
|
||||||
if (key == "zdefault_states")
|
if (key == "zdefault_states")
|
||||||
return pl;
|
return pl;
|
||||||
return powerLevels_.users_default;
|
return powerLevels_.users_default;
|
||||||
|
@ -359,7 +359,7 @@ std::map<std::string, mtx::events::state::power_level_t, std::less<>>
|
||||||
PowerlevelsUserListModel::toUsers()
|
PowerlevelsUserListModel::toUsers()
|
||||||
{
|
{
|
||||||
std::map<std::string, mtx::events::state::power_level_t, std::less<>> m;
|
std::map<std::string, mtx::events::state::power_level_t, std::less<>> m;
|
||||||
for (const auto &[key, pl] : users)
|
for (const auto &[key, pl] : qAsConst(users))
|
||||||
if (key.size() > 0 && key.at(0) == '@')
|
if (key.size() > 0 && key.at(0) == '@')
|
||||||
m[key] = pl;
|
m[key] = pl;
|
||||||
return m;
|
return m;
|
||||||
|
@ -367,7 +367,7 @@ PowerlevelsUserListModel::toUsers()
|
||||||
mtx::events::state::power_level_t
|
mtx::events::state::power_level_t
|
||||||
PowerlevelsUserListModel::usersDefault()
|
PowerlevelsUserListModel::usersDefault()
|
||||||
{
|
{
|
||||||
for (const auto &[key, pl] : users)
|
for (const auto &[key, pl] : qAsConst(users))
|
||||||
if (key == "default")
|
if (key == "default")
|
||||||
return pl;
|
return pl;
|
||||||
return powerLevels_.users_default;
|
return powerLevels_.users_default;
|
||||||
|
|
Loading…
Reference in a new issue