From 54a8e00a7e3348ed8acca07b2078608b699637dc Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 26 Nov 2013 14:52:28 +0000 Subject: (svn r26126) -Cleanup: remove unneeded check for NULL --- src/train_cmd.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/train_cmd.cpp') 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. */ -- cgit v1.2.3-54-g00ecf