File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ void Ship::addCargo(Cargo * item)
6363
6464void Ship::removeCargo (Cargo * item, size_t amount)
6565{
66- auto shipCargoAmount = findMatchCargo (item)->getAmount ();
66+ const auto shipCargoAmount = findMatchCargo (item)->getAmount ();
6767 if (shipCargoAmount == amount)
6868 {
69- auto it = std::find_if (begin (shipCargo), end (shipCargo), [item](const auto * el){ return *el == *item; });
69+ const auto it = std::find_if (begin (shipCargo), end (shipCargo), [item](const auto * el){ return *el == *item; });
7070 if (it != end (shipCargo)) {
7171 shipCargo.erase (it);
7272 }
@@ -96,7 +96,6 @@ void Ship::load(Cargo * loadCargo, size_t amount)
9696 Cargo* toAdd;
9797 if (Fruit* f = dynamic_cast <Fruit*>(loadCargo)){
9898 toAdd = new Fruit (*f);
99-
10099 }
101100 if (Item* i = dynamic_cast <Item*>(loadCargo)){
102101 toAdd = new Item (*i);
You can’t perform that action at this time.
0 commit comments