Mercurial > hg > openttd
changeset 16869:63f8b6eeb72c draft
(svn r21603) -Codechange: no need to assign something to a variable and then test it for NULL when you're never using it again
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 22 Dec 2010 21:19:39 +0000 |
parents | 6f39950083d8 |
children | 35ca0d633732 |
files | src/order_cmd.cpp |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -750,7 +750,6 @@ { VehicleID veh_id = GB(p1, 0, 20); VehicleOrderID sel_ord = GB(p2, 0, 8); - Order *order; Vehicle *v = Vehicle::GetIfValid(veh_id); @@ -762,8 +761,7 @@ /* If we did not select an order, we maybe want to de-clone the orders */ if (sel_ord >= v->GetNumOrders()) return DecloneOrder(v, flags); - order = v->GetOrder(sel_ord); - if (order == NULL) return CMD_ERROR; + if (v->GetOrder(sel_ord) == NULL) return CMD_ERROR; if (flags & DC_EXEC) DeleteOrder(v, sel_ord); return CommandCost();