Cleanup - addAll -> constructor parameter

This commit is contained in:
Jetz
2024-08-10 12:17:54 -04:00
parent b417946032
commit daa9d59a67
8 changed files with 9 additions and 19 deletions

View File

@@ -147,9 +147,8 @@ 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 %)

View File

@@ -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

View File

@@ -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

View File

@@ -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