I wouldnt stress too much about it.

My SIL works for maccas and she said they have such high quality and safety standards there she was really surprised just how vigilant they are. She assured me that everything is fresh there and would not have been hanging around for hours.

As has been said, just avoid the salads and anything with soft serve icecream in it, but that goes for any food establishment, not just maccas.

And yes, as has also been said, heat kills bacteria.