code: func (dest *Destination) Calculate(newPath *Path) *Update {
  	oldKnownPathList := make([]*Path, len(dest.knownPathList))
  	copy(oldKnownPathList, dest.knownPathList)
  
  	if newPath.IsWithdraw {
  		p := dest.explicitWithdraw(newPath)
  		if p != nil {
  			if id := p.GetNlri().PathLocalIdentifier(); id != 0 {
  				dest.localIdMap.Unflag(uint(id))
  			}
  		}
  	} else {
  		dest.implicitWithdraw(newPath)
  		dest.knownPathList = append(dest.knownPathList, newPath)
  	}
  
  	for _, path := range dest.knownPathList {
  		if path.GetNlri().PathLocalIdentifier() == 0 {
  			id, err := dest.localIdMap.FindandSetZeroBit()
  			if err != nil {
  				dest.localIdMap.Expand()
  				id, _ = dest.localIdMap.FindandSetZeroBit()
  			}
  			path.GetNlri().SetPathLocalIdentifier(uint32(id))
  		}
  	}
  	// Compute new best path
  	dest.computeKnownBestPath()
  
  	l := make([]*Path, len(dest.knownPathList))
  	copy(l, dest.knownPathList)
  	return &Update{
  		KnownPathList:    l,
  		OldKnownPathList: oldKnownPathList,
  	}
  }
docs: // Calculates best-path among known paths for this destination.
  //
  // Modifies destination's state related to stored paths. Removes withdrawn
  // paths from known paths. Also, adds new paths to known paths.