]> Cypherpunks repositories - gostls13.git/commit
Sort: reduced stack depth to lg(n) in quickSort
authorStefan Nilsson <snilsson@nada.kth.se>
Thu, 2 Dec 2010 17:18:20 +0000 (09:18 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 2 Dec 2010 17:18:20 +0000 (09:18 -0800)
commit6f1835dce02b592b28a4ea9bb9a77dbc990198a2
tree93bac2684ce8884074d290be0e53b43c85adf0d1
parent4e40a03682aca2f0283689b21f9dc5b2919fc464
Sort: reduced stack depth to lg(n) in quickSort

Doing the tail recursion elimination explicitly
seems safer than leaving it to the compiler;
the code is still clean and easy to understand.

R=r, r2, gri
CC=golang-dev
https://golang.org/cl/3373041
src/pkg/sort/sort.go