Use empty() method instead of size() for emptiness checks
Found by cppcheck.
This commit is contained in:
parent
11570ef4c0
commit
b1d3f609e5
1 changed files with 4 additions and 4 deletions
|
@ -332,10 +332,10 @@ void remove(int handle)
|
|||
|
||||
void unrender(std::set<map_location> invalidated_locations)
|
||||
{
|
||||
if(preferences::show_haloes() == false || haloes.size() == 0) {
|
||||
if(preferences::show_haloes() == false || haloes.empty()) {
|
||||
return;
|
||||
}
|
||||
//assert(invalidated_haloes.size() == 0);
|
||||
//assert(invalidated_haloes.empty());
|
||||
|
||||
// Remove expired haloes
|
||||
std::map<int, effect>::iterator itor = haloes.begin();
|
||||
|
@ -409,8 +409,8 @@ void unrender(std::set<map_location> invalidated_locations)
|
|||
|
||||
void render()
|
||||
{
|
||||
if(preferences::show_haloes() == false || haloes.size() == 0 ||
|
||||
(new_haloes.size() == 0 && invalidated_haloes.size() == 0)) {
|
||||
if(preferences::show_haloes() == false || haloes.empty() ||
|
||||
(new_haloes.empty() && invalidated_haloes.empty())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue