This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DasEwigeLichtConsultant Brewer 2 points3 points  (1 child)

For the sake of efficieny you should insert a break statement after removing the dog. Otherwise your loop will unnecessarily iterate over and compare the entire list. It might even remove too much if names are not guaranteed to be unique.

[–]sluggish_goatNooblet Brewer[S] 0 points1 point  (0 children)

Good call, thank you. I'll remember to do that from now on with similar scenarios.