From 0e8056c06a3935352f6444d072edbaa152fedd39 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 5 Jan 2020 21:40:19 +0100 Subject: [PATCH] Minor refactoring in theme resolver This should please our beloved static analysers, and speed up by _at least_ 0.2ms the themes selector loading time! --- .../java/org/airsonic/player/theme/CustomThemeResolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/theme/CustomThemeResolver.java b/airsonic-main/src/main/java/org/airsonic/player/theme/CustomThemeResolver.java index cce487c1..9f4ebe0c 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/theme/CustomThemeResolver.java +++ b/airsonic-main/src/main/java/org/airsonic/player/theme/CustomThemeResolver.java @@ -93,8 +93,8 @@ public class CustomThemeResolver implements ThemeResolver { private synchronized boolean themeExists(String themeId) { // Lazily create set of theme IDs. if (themeIds == null) { - themeIds = new HashSet(); Theme[] themes = settingsService.getAvailableThemes(); + themeIds = new HashSet<>(themes.length); for (Theme theme : themes) { themeIds.add(theme.getId()); }