diff options
author | rubidium <rubidium@openttd.org> | 2009-10-06 21:12:35 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-10-06 21:12:35 +0000 |
commit | d52fa73bb14314d80811482c840fc6fc3e485b80 (patch) | |
tree | 7bfb453b27ff4451e843880a367922832353be53 /src/cargopacket.h | |
parent | 31acc42b21105ced6bdc65bbb903cc71d57a99e3 (diff) | |
download | openttd-d52fa73bb14314d80811482c840fc6fc3e485b80.tar.xz |
(svn r17731) -Codechange: do not cache a boolean which states whether some other variable is not 0.
Diffstat (limited to 'src/cargopacket.h')
-rw-r--r-- | src/cargopacket.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cargopacket.h b/src/cargopacket.h index c5d0bf822..7f8114c2d 100644 --- a/src/cargopacket.h +++ b/src/cargopacket.h @@ -163,7 +163,6 @@ public: private: List packets; ///< The cargo packets in this list - bool empty; ///< Cache for whether this list is empty or not uint count; ///< Cache for the number of cargo entities Money feeder_share; ///< Cache for the feeder share uint days_in_transit; ///< Cache for the number of days in transit @@ -197,7 +196,7 @@ public: */ FORCEINLINE bool Empty() const { - return this->empty; + return this->count == 0; } /** @@ -224,7 +223,7 @@ public: */ FORCEINLINE StationID Source() const { - return this->Empty() ? INVALID_STATION : this->packets.front()->source;; + return this->Empty() ? INVALID_STATION : this->packets.front()->source; } /** |