Ваши комментарии

Yeah, I agree. The solution needs to calculate the base price three times. I also miss the `quantity` and `itemPrice` initialization.

The cost of the operation for this one is small, though. The performance impact won't be big, because the calulcation is very trivial. It can be fixed by creating a class that caches the value. That's what I would do in this case. The object would get the `quantity` and `itemPrice` as associations and have a method to calculate the price. That will increase the lines of code, but gives more reusability and no performance loss.



Сервис поддержки клиентов работает на платформе UserEcho