From ebaea5812de2e36a41141f91e0e7c912b915a630 Mon Sep 17 00:00:00 2001 From: Alexander van Gessel Date: Fri, 20 Jun 2014 01:26:24 +0200 Subject: [PATCH] Rewrite some logic so C++11 considers it a boolean context --- src/unit_map.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/unit_map.hpp b/src/unit_map.hpp index 2a9e22ed2d11..d1e1655c089f 100644 --- a/src/unit_map.hpp +++ b/src/unit_map.hpp @@ -227,10 +227,7 @@ class unit_map { } bool valid() const { - if(valid_for_dereference()) { - return static_cast (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_ ); }