code: func (proxier *Proxier) updateServiceMap() (result updateServiceMapResult) {
  	result.staleServices = sets.NewString()
  
  	var serviceMap proxyServiceMap = proxier.serviceMap
  	var changes *serviceChangeMap = &proxier.serviceChanges
  
  	func() {
  		changes.lock.Lock()
  		defer changes.lock.Unlock()
  		for _, change := range changes.items {
  			existingPorts := serviceMap.merge(change.current, proxier.endpointsMap)
  			serviceMap.unmerge(change.previous, existingPorts, result.staleServices, proxier.endpointsMap)
  		}
  		changes.items = make(map[types.NamespacedName]*serviceChange)
  	}()
  
  	// TODO: If this will appear to be computationally expensive, consider
  	// computing this incrementally similarly to serviceMap.
  	result.hcServices = make(map[types.NamespacedName]uint16)
  	for svcPortName, info := range serviceMap {
  		if info.healthCheckNodePort != 0 {
  			result.hcServices[svcPortName.NamespacedName] = uint16(info.healthCheckNodePort)
  		}
  	}
  
  	return result
  }
docs: // <serviceMap> is updated by this function (based on the given changes).
  // <changes> map is cleared after applying them.