<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _update_heap(self, peer):
 """Recalculate the peer's rank and update itself in the peer heap."""

        rank = self.rank_calculator.get_rank(peer)
        if rank == peer.rank:
            return

        peer.rank = rank
        self.peer_heap.update_peer(peer)