Remove unnecessary memoize() calls

This commit is contained in:
Reinhard Pointner 2017-03-14 18:20:50 +08:00
parent 458c3630de
commit 415349ab71
2 changed files with 3 additions and 9 deletions

View File

@ -133,9 +133,7 @@ public final class WebServices {
}
// local TheTVDB search index
private final Resource<LocalSearch<SearchResult>> localIndex = Resource.lazy(() -> {
return new LocalSearch<SearchResult>(releaseInfo.getTheTVDBIndex(), SearchResult::getEffectiveNames);
}).memoize();
private final Resource<LocalSearch<SearchResult>> localIndex = Resource.lazy(() -> new LocalSearch<SearchResult>(releaseInfo.getTheTVDBIndex(), SearchResult::getEffectiveNames));
private SearchResult merge(SearchResult prime, List<SearchResult> group) {
int id = prime.getId();
@ -177,9 +175,7 @@ public final class WebServices {
}
// local OpenSubtitles search index
private final Resource<LocalSearch<SubtitleSearchResult>> localIndex = Resource.lazy(() -> {
return new LocalSearch<SubtitleSearchResult>(releaseInfo.getOpenSubtitlesIndex(), SearchResult::getEffectiveNames);
}).memoize();
private final Resource<LocalSearch<SubtitleSearchResult>> localIndex = Resource.lazy(() -> new LocalSearch<SubtitleSearchResult>(releaseInfo.getOpenSubtitlesIndex(), SearchResult::getEffectiveNames));
@Override
public List<SubtitleSearchResult> search(final String query) throws Exception {

View File

@ -80,9 +80,7 @@ public class AnidbClient extends AbstractEpisodeListProvider {
}
// local AniDB search index
private final Resource<LocalSearch<SearchResult>> localIndex = Resource.lazy(() -> {
return new LocalSearch<SearchResult>(getAnimeTitles(), SearchResult::getEffectiveNames);
}).memoize();
private final Resource<LocalSearch<SearchResult>> localIndex = Resource.lazy(() -> new LocalSearch<SearchResult>(getAnimeTitles(), SearchResult::getEffectiveNames));
@Override
public List<SearchResult> fetchSearchResult(String query, Locale locale) throws Exception {