From 8ffbe05437e4fa901eb32ae4e6e424f8402a75f1 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 17 Jan 2018 18:39:20 +0100 Subject: [PATCH] Sligthly simplified buildImportMenu loop --- app/src/processing/app/Base.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 3134a0791..1752e1dc8 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1102,11 +1102,12 @@ public class Base { List libs = getSortedLibraries(); String lastLibType = null; for (ContributedLibrary lib : libs) { - if (lastLibType == null || !lastLibType.equals(lib.getTypes().get(0))) { + String libType = lib.getTypes().get(0); + if (!libType.equals(lastLibType)) { if (lastLibType != null) { importMenu.addSeparator(); } - lastLibType = lib.getTypes().get(0); + lastLibType = libType; JMenuItem platformItem = new JMenuItem(I18n.format(tr("{0} libraries"), tr(lastLibType))); platformItem.setEnabled(false); importMenu.add(platformItem);