Remove unused variable doTreeWalk.