Avoid double lookup in cdm association store
This CL avoids unnecessary calls to getDeviceMacAddress() in the updateAssociations method. Test: atest CtsCompanionDeviceManagerCoreTestCases Test: atest CtsCompanionDeviceManagerUiAutomationTestCases Change-Id: I35cfb24afe6ad3345347fe9e385935fea481407f
This commit is contained in:
@@ -125,8 +125,7 @@ class AssociationStoreImpl implements AssociationStore {
|
||||
// Update the MacAddress-to-List<Association> map if needed.
|
||||
final MacAddress updatedAddress = updated.getDeviceMacAddress();
|
||||
final MacAddress currentAddress = current.getDeviceMacAddress();
|
||||
macAddressChanged = Objects.equals(
|
||||
current.getDeviceMacAddress(), updated.getDeviceMacAddress());
|
||||
macAddressChanged = Objects.equals(currentAddress, updatedAddress);
|
||||
if (macAddressChanged) {
|
||||
if (currentAddress != null) {
|
||||
mAddressMap.get(currentAddress).remove(id);
|
||||
|
||||
Reference in New Issue
Block a user