Ticket #5615: Avoid calling the same function n times when once is enough.
Merge pull request #326 from simartin/ticket_5615_avoid_useless_similar_calls

Ticket #5615: Avoid calling the same function n times when once is enough