Code Trivia: optimize the code for multiple nested loops
- by CodeToGlory
I came across this code today and wondering what are some of the ways we can optimize it.
Obviously the model is hard to change as it is legacy, but interested in getting opinions.
Changed some names around and blurred out some core logic to protect.
private static Payment FindPayment(Order order, Customer customer, int paymentId)
{
…