I was looking at the quick sort algorithm in CLRS's Introduction to Algorithms https://dl.ebooksworld.ir/books/Introduction.to.Algorithms.4th.Leiserson.Stein.Rivest.Cormen.MIT.Press.9780262046305.EBooksWorld.ir.pdf
On pg 184, it shows the partition algorithm, pasted below for convenience:
It's been many years since I've looked at this, but now I don't understand why we need line 7 as opposed to make the loop go from j = p to j = r, and return i. Is there some performance improvement to doing it as shown in the picture?
