code: def _update_heap(self, peer):
          
          rank = self.rank_calculator.get_rank(peer)
          if rank == peer.rank:
              return
  
          peer.rank = rank
          self.peer_heap.update_peer(peer)
docs: Recalculate the peer's rank and update itself in the peer heap.