Small refactor battery usage code according to the comments in previous cls.
Bug: 262802531 Test: presubmit Change-Id: I0d496fc6a41af5964311dafe8dd89f8b8058de82
This commit is contained in:
@@ -313,11 +313,8 @@ public class BatteryUsageBreakdownController extends BasePreferenceController
|
||||
@VisibleForTesting
|
||||
void removeAndCacheAllUnusedPreferences() {
|
||||
List<BatteryDiffEntry> entries = getBatteryDiffEntries();
|
||||
Set<String> entryKeySet = new ArraySet<>();
|
||||
for (BatteryDiffEntry entry : entries) {
|
||||
entryKeySet.add(entry.getKey());
|
||||
}
|
||||
|
||||
Set<String> entryKeySet = new ArraySet<>(entries.size());
|
||||
entries.forEach(entry -> entryKeySet.add(entry.getKey()));
|
||||
final int prefsCount = mAppListPreferenceGroup.getPreferenceCount();
|
||||
for (int index = prefsCount - 1; index >= 0; index--) {
|
||||
final Preference pref = mAppListPreferenceGroup.getPreference(index);
|
||||
|
Reference in New Issue
Block a user