[revwalk] improve functions