Skip to content

Commit

Permalink
Rewrite some logic so C++11 considers it a boolean context
Browse files Browse the repository at this point in the history
  • Loading branch information
AI0867 committed Jun 19, 2014
1 parent af2d16a commit ebaea58
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/unit_map.hpp
Expand Up @@ -227,10 +227,7 @@ class unit_map {
}

bool valid() const {
if(valid_for_dereference()) {
return static_cast<bool> (i_->second.unit);
}
return false;
return (valid_for_dereference() && i_->second.unit);
}

bool operator==(const iterator_base &rhs) const { return (tank_ == rhs.tank_) && ( i_ == rhs.i_ ); }
Expand Down

0 comments on commit ebaea58

Please sign in to comment.