remove unnecessary variable in heap sort