From 01fa0a56ea7e156ff2ad0fcc78a45554767619a0 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 14 Jan 2018 17:59:51 +0100 Subject: [PATCH] Replace manual array t collection copy --- .../antennapod/core/preferences/GpodnetPreferences.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java index f14c9e36c..8efedcfc8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java @@ -7,6 +7,7 @@ import android.util.Log; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -316,9 +317,7 @@ public class GpodnetPreferences { private static Set readListFromString(String s) { Set result = new HashSet<>(); - for (String item : s.split(" ")) { - result.add(item); - } + Collections.addAll(result, s.split(" ")); return result; }