func MergedAddresses(machineAddresses, providerAddresses []SpaceAddress) []SpaceAddress {
	merged := make([]SpaceAddress, 0, len(providerAddresses)+len(machineAddresses))
	providerValues := set.NewStrings()
	for _, address := range providerAddresses {
		// Older versions of Juju may have stored an empty address so ignore it here.
		if address.Value == "" || providerValues.Contains(address.Value) {
			continue
		}
		providerValues.Add(address.Value)
		merged = append(merged, address)
	}
	for _, address := range machineAddresses {
		if !providerValues.Contains(address.Value) {
			merged = append(merged, address)
		}
	}
	return merged
}
// MergedAddresses provides a single list of addresses without duplicates
// suitable for returning as an address list for a machine.
// TODO (cherylj) Add explicit unit tests - tracked with bug #1544158
MergedAddresses provides a single list of addresses without duplicates
suitable for returning as an address list for a machine.
TODO (cherylj) Add explicit unit tests - tracked with bug #1544158
// MergedAddresses provides a single list of addresses without duplicates // suitable for returning as an address list for a machine . // TODO ( cherylj ) Add explicit unit tests - tracked with bug #1544158
func MergedAddresses(machineAddresses, providerAddresses []SpaceAddress) []SpaceAddress {
	merged := make([]SpaceAddress, 0, len(providerAddresses)+len(machineAddresses))
	providerValues := set.NewStrings()
	for _, address := range providerAddresses {
		if address.Value == "" || providerValues.Contains(address.Value) {
			continue
		}
		providerValues.Add(address.Value)
		merged = append(merged, address)
	}
	for _, address := range machineAddresses {
		if !providerValues.Contains(address.Value) {
			merged = append(merged, address)
		}
	}
	return merged
}
func MergedAddresses ( machineAddresses , providerAddresses [ ] SpaceAddress ) [ ] SpaceAddress { merged := make ( [ ] SpaceAddress , 0 , len ( providerAddresses ) + len ( machineAddresses ) ) providerValues := set . NewStrings ( ) for _ , address := range providerAddresses { if address . Value == " " || providerValues . Contains ( address . Value ) { continue } providerValues . Add ( address . Value ) merged = append ( merged , address ) } for _ , address := range machineAddresses { if ! providerValues . Contains ( address . Value ) { merged = append ( merged , address ) } } return merged }
MergedAddresses provides a single list of addresses without duplicates
suitable for returning as an address list for a machine.
MergedAddresses provides a single list of addresses without duplicates suitable for returning as an address list for a machine .
// Older versions of Juju may have stored an empty address so ignore it here.