If you go through all the values without having to swap the sort is done.
That means the sort is done when the swapped flag is "Not True", i.e. that it is "False".

You can test expressions to see...