I was reading the implementation of sort in go, and there is this particular loop in the implementation of func Sort(data Interface)
:
for i := n; i > 0; i >>= 1 {
maxDepth++
}
Sort implementation : https://golang.org/src/sort/sort.go
Can someone explain to me what does the >>= operator do ?
Edit: It's simply a shift followed by an affectation. I think the fact it was in a loop bugged my mind.