* cache compiled patterns
This commit is contained in:
parent
0c3406f0b0
commit
59138a3581
|
@ -193,7 +193,7 @@ public class ReleaseInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
volumeRoots = volumes;
|
volumeRoots = unmodifiableSet(volumes);
|
||||||
}
|
}
|
||||||
return volumeRoots;
|
return volumeRoots;
|
||||||
}
|
}
|
||||||
|
@ -271,15 +271,20 @@ public class ReleaseInfo {
|
||||||
return anidbIndexResource.get();
|
return anidbIndexResource.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<Pattern, String> seriesDirectMappings;
|
||||||
|
|
||||||
public Map<Pattern, String> getSeriesDirectMappings() throws IOException {
|
public Map<Pattern, String> getSeriesDirectMappings() throws IOException {
|
||||||
Map<Pattern, String> mappings = new LinkedHashMap<Pattern, String>();
|
if (seriesDirectMappings == null) {
|
||||||
for (String line : seriesDirectMappingsResource.get()) {
|
Map<Pattern, String> mappings = new LinkedHashMap<Pattern, String>();
|
||||||
String[] tsv = line.split("\t", 2);
|
for (String line : seriesDirectMappingsResource.get()) {
|
||||||
if (tsv.length == 2) {
|
String[] tsv = line.split("\t", 2);
|
||||||
mappings.put(compile("(?<!\\p{Alnum})(" + tsv[0] + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CASE), tsv[1]);
|
if (tsv.length == 2) {
|
||||||
|
mappings.put(compile("(?<!\\p{Alnum})(" + tsv[0] + ")(?!\\p{Alnum})", CASE_INSENSITIVE | UNICODE_CASE), tsv[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
seriesDirectMappings = unmodifiableMap(mappings);
|
||||||
}
|
}
|
||||||
return mappings;
|
return seriesDirectMappings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileFilter getDiskFolderFilter() {
|
public FileFilter getDiskFolderFilter() {
|
||||||
|
|
Loading…
Reference in New Issue