mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Cleanup - addAll -> constructor parameter
This commit is contained in:
@@ -272,10 +272,7 @@ public enum Keyword {
|
||||
|
||||
public static List<Keyword> getAllKeywords() {
|
||||
Keyword[] values = values();
|
||||
List<Keyword> keywords = new ArrayList<>();
|
||||
for (int i = 1; i < values.length; i++) { //skip UNDEFINED
|
||||
keywords.add(values[i]);
|
||||
}
|
||||
List<Keyword> keywords = new ArrayList<>(Arrays.asList(values).subList(1, values.length)); //skip UNDEFINED
|
||||
return keywords;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,8 +148,7 @@ public final class SResizingUtil {
|
||||
double roughVal = 0;
|
||||
int smoothVal = 0;
|
||||
|
||||
Set<Component> existingComponents = new HashSet<>();
|
||||
existingComponents.addAll(Arrays.asList(pnlContent.getComponents()));
|
||||
Set<Component> existingComponents = new HashSet<>(Arrays.asList(pnlContent.getComponents()));
|
||||
|
||||
// This is the core of the pixel-perfect layout. To avoid ±1 px errors on borders
|
||||
// from rounding individual panels, the intermediate values (exactly accurate, in %)
|
||||
|
||||
@@ -45,8 +45,7 @@ public class ContestGauntletLister extends JPanel {
|
||||
public void setGauntlets(final List<GauntletData> gd0) {
|
||||
this.removeAll();
|
||||
final List<RowPanel> tempRows = new ArrayList<>();
|
||||
final List<GauntletData> sorted = new ArrayList<>();
|
||||
sorted.addAll(gd0);
|
||||
final List<GauntletData> sorted = new ArrayList<>(gd0);
|
||||
Collections.sort(sorted, Comparator.comparing(GauntletData::getName));
|
||||
|
||||
// Title row
|
||||
|
||||
@@ -64,8 +64,7 @@ public class QuickGauntletLister extends JPanel {
|
||||
public void refresh() {
|
||||
this.removeAll();
|
||||
final List<RowPanel> tempRows = new ArrayList<>();
|
||||
final List<GauntletData> sorted = new ArrayList<>();
|
||||
sorted.addAll(gauntlets);
|
||||
final List<GauntletData> sorted = new ArrayList<>(gauntlets);
|
||||
Collections.sort(sorted, Comparator.comparing(x -> x.getName().toLowerCase()));
|
||||
|
||||
// Title row
|
||||
|
||||
@@ -76,8 +76,7 @@ public class QuestFileLister extends JPanel {
|
||||
public void setQuests(List<QuestData> qd0) {
|
||||
this.removeAll();
|
||||
List<RowPanel> tempRows = new ArrayList<>();
|
||||
List<QuestData> sorted = new ArrayList<>();
|
||||
sorted.addAll(qd0);
|
||||
List<QuestData> sorted = new ArrayList<>(qd0);
|
||||
Collections.sort(sorted, Comparator.comparing(x -> x.getName().toLowerCase()));
|
||||
|
||||
// Title row
|
||||
|
||||
@@ -273,8 +273,7 @@ public class LoadGauntletScreen extends LaunchScreen {
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
List<GauntletData> sorted = new ArrayList<>();
|
||||
sorted.addAll(gauntlets);
|
||||
List<GauntletData> sorted = new ArrayList<>(gauntlets);
|
||||
Collections.sort(sorted, Comparator.comparing(x -> x.getName().toLowerCase()));
|
||||
setListData(sorted);
|
||||
}
|
||||
|
||||
@@ -301,8 +301,7 @@ public class LoadConquestScreen extends LaunchScreen {
|
||||
}
|
||||
|
||||
public void setConquests(List<ConquestData> qd0) {
|
||||
List<ConquestData> sorted = new ArrayList<>();
|
||||
sorted.addAll(qd0);
|
||||
List<ConquestData> sorted = new ArrayList<>(qd0);
|
||||
Collections.sort(sorted, Comparator.comparing(x -> x.getName().toLowerCase()));
|
||||
setListData(sorted);
|
||||
}
|
||||
|
||||
@@ -300,8 +300,7 @@ public class LoadQuestScreen extends LaunchScreen {
|
||||
}
|
||||
|
||||
public void setQuests(List<QuestData> qd0) {
|
||||
List<QuestData> sorted = new ArrayList<>();
|
||||
sorted.addAll(qd0);
|
||||
List<QuestData> sorted = new ArrayList<>(qd0);
|
||||
Collections.sort(sorted, Comparator.comparing(x -> x.getName().toLowerCase()));
|
||||
setListData(sorted);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user