Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74ecf427 authored by Gitsaibot's avatar Gitsaibot Committed by Jochen Sprickerhof
Browse files

Iteration replaced with bulk 'Collection.addAll'

parent e269a3b8
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import com.android.calendar.CalendarUtils.TimeZoneUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Formatter;
import java.util.HashMap;
import java.util.Iterator;
@@ -341,9 +342,7 @@ public class Utils {
    public static void setSharedPreference(Context context, String key, String[] values) {
        SharedPreferences prefs = GeneralPreferences.getSharedPreferences(context);
        LinkedHashSet<String> set = new LinkedHashSet<String>();
        for (String value : values) {
            set.add(value);
        }
        Collections.addAll(set, values);
        prefs.edit().putStringSet(key, set).apply();
    }

+2 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.calendar.event;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
@@ -86,9 +87,7 @@ public class EventColorCache implements Serializable {
            Integer[] sortedColors = new Integer[palette.size()];
            Arrays.sort(palette.toArray(sortedColors), comparator);
            palette.clear();
            for (Integer color : sortedColors) {
                palette.add(color);
            }
            Collections.addAll(palette, sortedColors);
            mColorPaletteMap.put(key, palette);
        }
    }