Optimize calls to set_tip_to()

Follow-on from #2480. This is another commit that was originally in #2352.