summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-26 14:52:28 +0000
committerrubidium <rubidium@openttd.org>2013-11-26 14:52:28 +0000
commit54a8e00a7e3348ed8acca07b2078608b699637dc (patch)
tree55f9dc25b1af2e033df901609a37d0c8da2b8349
parent982fcb7aabc6ee0261e6ceebe714e7c2e5b99209 (diff)
downloadopenttd-54a8e00a7e3348ed8acca07b2078608b699637dc.tar.xz
(svn r26126) -Cleanup: remove unneeded check for NULL
-rw-r--r--src/train_cmd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 401877978..8b1062022 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1219,8 +1219,10 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
Train *original_src_head = src_head;
Train *original_dst_head = (dst_head == src_head ? NULL : dst_head);
- /* We want this information from before the rearrangement, but execute this after the validation. */
- bool original_src_head_front_engine = original_src_head != NULL && original_src_head->IsFrontEngine();
+ /* We want this information from before the rearrangement, but execute this after the validation.
+ * original_src_head can't be NULL; src is by definition != NULL, so src_head can't be NULL as
+ * src->GetFirst() always yields non-NULL, so eventually original_src_head != NULL as well. */
+ bool original_src_head_front_engine = original_src_head->IsFrontEngine();
bool original_dst_head_front_engine = original_dst_head != NULL && original_dst_head->IsFrontEngine();
/* (Re)arrange the trains in the wanted arrangement. */