code: func (e ActualLRPEventCalculator) RecordChange(before, after *models.ActualLRP, lrps []*models.ActualLRP) []*models.ActualLRP {
  	found := false
  	newLRPs := []*models.ActualLRP{}
  	for _, l := range lrps {
  		if l == nil {
  			// this entry is recording a LRP removal, just skip it
  			newLRPs = append(newLRPs, nil)
  			continue
  		}
  
  		if before != nil && l.ActualLRPInstanceKey.Equal(before.ActualLRPInstanceKey) {
  			newLRPs = append(newLRPs, after)
  			found = true
  		} else {
  			newLRPs = append(newLRPs, l)
  		}
  	}
  
  	if !found {
  		newLRPs = append(newLRPs, after)
  	}
  
  	return newLRPs
  }
docs: // RecordChange returns a new LRP set with the before LRP replaced with after
  // LRP.  The index of after and before is the same.  New LRPs (i.e. when before
  // is nil) are appended to the end of the lrp slice.