Skip to content

Commit

Permalink
Use empty() method instead of size() for emptiness checks
Browse files Browse the repository at this point in the history
Found by cppcheck.
  • Loading branch information
irydacea committed Jul 7, 2015
1 parent 11570ef commit b1d3f60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/halo.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b1d3f60

Please sign in to comment.