func (w *secretsRotationWatcher) mergeChanges(current, newChanges []watcher.SecretRotationChange) []watcher.SecretRotationChange {
	chMap := make(map[int]watcher.SecretRotationChange)
	for _, c := range current {
		chMap[c.ID] = c
	}
	for _, c := range newChanges {
		chMap[c.ID] = c
	}
	result := make([]watcher.SecretRotationChange, len(chMap))
	i := 0
	for _, c := range chMap {
		result[i] = c
		i++
	}
	return result
}
// mergeChanges combines the changes in current and newChanges, such that we end up with
// only one change per rotation config change in the result; the most recent change wins.
mergeChanges combines the changes in current and newChanges, such that we end up with
only one change per rotation config change in the result; the most recent change wins.
// mergeChanges combines the changes in current and newChanges such that we end up with // only one change per rotation config change in the result ; the most recent change wins .
func (w *secretsRotationWatcher) mergeChanges(current, newChanges []watcher.SecretRotationChange) []watcher.SecretRotationChange {
	chMap := make(map[int]watcher.SecretRotationChange)
	for _, c := range current {
		chMap[c.ID] = c
	}
	for _, c := range newChanges {
		chMap[c.ID] = c
	}
	result := make([]watcher.SecretRotationChange, len(chMap))
	i := 0
	for _, c := range chMap {
		result[i] = c
		i++
	}
	return result
}
func ( w * secretsRotationWatcher ) mergeChanges ( current , newChanges [ ] watcher . SecretRotationChange ) [ ] watcher . SecretRotationChange { chMap := make ( map [ int ] watcher . SecretRotationChange ) for _ , c := range current { chMap [ c . ID ] = c } for _ , c := range newChanges { chMap [ c . ID ] = c } result := make ( [ ] watcher . SecretRotationChange , len ( chMap ) ) i := 0 for _ , c := range chMap { result [ i ] = c i ++ } return result }
mergeChanges combines the changes in current and newChanges, such that we end up with
only one change per rotation config change in the result; the most recent change wins.
mergeChanges combines the changes in current and newChanges such that we end up with only one change per rotation config change in the result ; the most recent change wins .