From 4e7f45f244bd91c001e4adc4198fdcf2b27a35b5 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 4 Aug 2016 20:29:33 +0800 Subject: [PATCH] Refactor --- source/net/filebot/format/ExpressionFormatFunctions.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/format/ExpressionFormatFunctions.java b/source/net/filebot/format/ExpressionFormatFunctions.java index c83d8d35..2745166f 100644 --- a/source/net/filebot/format/ExpressionFormatFunctions.java +++ b/source/net/filebot/format/ExpressionFormatFunctions.java @@ -54,10 +54,11 @@ public class ExpressionFormatFunctions { } public static Map csv(String path) throws IOException { + Pattern[] delimiter = { TAB, SEMICOLON }; Map map = new LinkedHashMap(); streamLines(new File(path)).forEach(line -> { - for (Pattern delim : new Pattern[] { TAB, SEMICOLON }) { - String[] field = delim.split(line, 2); + for (Pattern d : delimiter) { + String[] field = d.split(line, 2); if (field.length >= 2) { map.put(field[0].trim(), field[1].trim()); break;