From fc177c5fabbb79946d4a3ef21ba2bd58919a29c0 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 6 Aug 2014 14:17:29 +0000 Subject: [PATCH] * prefer List over Array --- source/net/filebot/similarity/EpisodeMatcher.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/net/filebot/similarity/EpisodeMatcher.java b/source/net/filebot/similarity/EpisodeMatcher.java index 90f05002..66b0d627 100644 --- a/source/net/filebot/similarity/EpisodeMatcher.java +++ b/source/net/filebot/similarity/EpisodeMatcher.java @@ -59,10 +59,10 @@ public class EpisodeMatcher extends Matcher { continue; if (uniqueFiles.equals(uniqueEpisodes)) { - Episode[] episodes = episodeSets.get(file).toArray(new Episode[0]); + List episodes = episodeSets.get(file); if (isMultiEpisode(episodes)) { - MultiEpisode episode = new MultiEpisode(episodes); + MultiEpisode episode = new MultiEpisode(episodes.toArray(new Episode[0])); disjointMatchCollection.add(new Match(file, episode)); modified = true; } @@ -111,9 +111,9 @@ public class EpisodeMatcher extends Matcher { return identifier; } - private boolean isMultiEpisode(Episode[] episodes) { + private boolean isMultiEpisode(List episodes) { // sanity check that there is valid episode data for at least two episodes - if (episodes.length < 2) + if (episodes.size() < 2) return false; // check episode sequence integrity