func (w *offerStatusWatcher) mergeChanges(current, new []watcher.OfferStatusChange) []watcher.OfferStatusChange {
	chMap := make(map[string]watcher.OfferStatusChange)
	for _, c := range current {
		chMap[c.Name] = c
	}
	for _, c := range new {
		chMap[c.Name] = c
	}
	var result []watcher.OfferStatusChange
	for _, c := range chMap {
		result = append(result, c)
	}
	return result
}
// mergeChanges combines the status changes in current and new, such that we end up with
// only one change per offer in the result; the most recent change wins.
mergeChanges combines the status changes in current and new, such that we end up with
only one change per offer in the result; the most recent change wins.
// mergeChanges combines the status changes in current and new such that we end up with // only one change per offer in the result ; the most recent change wins .
func (w *offerStatusWatcher) mergeChanges(current, new []watcher.OfferStatusChange) []watcher.OfferStatusChange {
	chMap := make(map[string]watcher.OfferStatusChange)
	for _, c := range current {
		chMap[c.Name] = c
	}
	for _, c := range new {
		chMap[c.Name] = c
	}
	var result []watcher.OfferStatusChange
	for _, c := range chMap {
		result = append(result, c)
	}
	return result
}
func ( w * offerStatusWatcher ) mergeChanges ( current , new [ ] watcher . OfferStatusChange ) [ ] watcher . OfferStatusChange { chMap := make ( map [ string ] watcher . OfferStatusChange ) for _ , c := range current { chMap [ c . Name ] = c } for _ , c := range new { chMap [ c . Name ] = c } var result [ ] watcher . OfferStatusChange for _ , c := range chMap { result = append ( result , c ) } return result }
mergeChanges combines the status changes in current and new, such that we end up with
only one change per offer in the result; the most recent change wins.
mergeChanges combines the status changes in current and new such that we end up with only one change per offer in the result ; the most recent change wins .