Skip to content

Commit 8ffbe05

Browse files
committed
Sligthly simplified buildImportMenu loop
1 parent 534d626 commit 8ffbe05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: app/src/processing/app/Base.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1102,11 +1102,12 @@ public void actionPerformed(ActionEvent e) {
11021102
List<ContributedLibrary> libs = getSortedLibraries();
11031103
String lastLibType = null;
11041104
for (ContributedLibrary lib : libs) {
1105-
if (lastLibType == null || !lastLibType.equals(lib.getTypes().get(0))) {
1105+
String libType = lib.getTypes().get(0);
1106+
if (!libType.equals(lastLibType)) {
11061107
if (lastLibType != null) {
11071108
importMenu.addSeparator();
11081109
}
1109-
lastLibType = lib.getTypes().get(0);
1110+
lastLibType = libType;
11101111
JMenuItem platformItem = new JMenuItem(I18n.format(tr("{0} libraries"), tr(lastLibType)));
11111112
platformItem.setEnabled(false);
11121113
importMenu.add(platformItem);

0 commit comments

Comments
 (0)