mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix various points reported by cppcheck (#5656)
* Fix various performance issues reported by cppcheck + code style (CI) * Make CI happy with code style on master * guiFileSelectMenu: remove useless includes * some performance fixes pointed by cppcheck * remove some useless casts * TextDest: remove unused setFormSpec function * Fix various iterator post-increment reported by cppcheck
This commit is contained in:
parent
af96309621
commit
a7e131f53e
13 changed files with 29 additions and 31 deletions
|
@ -1318,22 +1318,21 @@ void CNodeDefManager::removeNode(const std::string &name)
|
|||
|
||||
// Erase node content from all groups it belongs to
|
||||
for (UNORDERED_MAP<std::string, GroupItems>::iterator iter_groups =
|
||||
m_group_to_items.begin();
|
||||
iter_groups != m_group_to_items.end();) {
|
||||
m_group_to_items.begin(); iter_groups != m_group_to_items.end();) {
|
||||
GroupItems &items = iter_groups->second;
|
||||
for (GroupItems::iterator iter_groupitems = items.begin();
|
||||
iter_groupitems != items.end();) {
|
||||
if (iter_groupitems->first == id)
|
||||
items.erase(iter_groupitems++);
|
||||
else
|
||||
iter_groupitems++;
|
||||
++iter_groupitems;
|
||||
}
|
||||
|
||||
// Check if group is empty
|
||||
if (items.size() == 0)
|
||||
m_group_to_items.erase(iter_groups++);
|
||||
else
|
||||
iter_groups++;
|
||||
++iter_groups;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue