improvements

This commit is contained in:
simon 2020-12-04 15:12:28 +02:00
parent c206cfc212
commit cb0593e2cd

View file

@ -20,7 +20,6 @@ import net.osmand.plus.R;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils; import net.osmand.util.MapUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import java.io.File; import java.io.File;
@ -159,17 +158,17 @@ public class TravelObfHelper implements TravelHelper {
res.add(searchResult); res.add(searchResult);
} }
} }
res = Lists.newArrayList(groupSearchResultsByCityId(res).iterator()); res = new ArrayList<>(groupSearchResultsByCityId(res));
sortSearchResults(searchQuery, res); sortSearchResults(searchQuery, res);
return res; return res;
} }
private WikivoyageSearchResult convertArticleToSearchResult(TravelArticle article) { private WikivoyageSearchResult convertArticleToSearchResult(TravelArticle article) {
WikivoyageSearchResult searchResult = new WikivoyageSearchResult(); WikivoyageSearchResult searchResult = new WikivoyageSearchResult();
searchResult.articleTitles = Collections.singletonList(article.title); searchResult.articleTitles = new ArrayList<>(Collections.singletonList(article.title));
searchResult.isPartOf = Collections.singletonList(article.isPartOf); searchResult.isPartOf = new ArrayList<>(Collections.singletonList(article.isPartOf));
searchResult.imageTitle = article.imageTitle; searchResult.imageTitle = article.imageTitle;
searchResult.langs = Collections.singletonList(article.lang); searchResult.langs = new ArrayList<>(Collections.singletonList(article.lang));
searchResult.tripId = article.tripId; searchResult.tripId = article.tripId;
return searchResult; return searchResult;
} }