Fixed unused array
This commit is contained in:
parent
fbfe84fa52
commit
3c996a41a9
1 changed files with 17 additions and 16 deletions
|
@ -362,22 +362,23 @@ public class TravelDbHelper {
|
||||||
cursor.close();
|
cursor.close();
|
||||||
}
|
}
|
||||||
LinkedHashMap<WikivoyageSearchResult, List<WikivoyageSearchResult>> res = new LinkedHashMap<>();
|
LinkedHashMap<WikivoyageSearchResult, List<WikivoyageSearchResult>> res = new LinkedHashMap<>();
|
||||||
parts = parts == null ? new String[]{} : parts;
|
if (parts != null) {
|
||||||
for (String header : parts) {
|
for (String header : parts) {
|
||||||
WikivoyageSearchResult searchResult = headerObjs.get(header);
|
WikivoyageSearchResult searchResult = headerObjs.get(header);
|
||||||
List<WikivoyageSearchResult> results = navMap.get(header);
|
List<WikivoyageSearchResult> results = navMap.get(header);
|
||||||
if (results != null) {
|
if (results != null) {
|
||||||
Collections.sort(results, new Comparator<WikivoyageSearchResult>() {
|
Collections.sort(results, new Comparator<WikivoyageSearchResult>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(WikivoyageSearchResult o1, WikivoyageSearchResult o2) {
|
public int compare(WikivoyageSearchResult o1, WikivoyageSearchResult o2) {
|
||||||
return collator.compare(o1.articleTitles.get(0), o2.articleTitles.get(0));
|
return collator.compare(o1.articleTitles.get(0), o2.articleTitles.get(0));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
WikivoyageSearchResult emptyResult = new WikivoyageSearchResult();
|
WikivoyageSearchResult emptyResult = new WikivoyageSearchResult();
|
||||||
emptyResult.articleTitles.add(header);
|
emptyResult.articleTitles.add(header);
|
||||||
emptyResult.cityId = -1;
|
emptyResult.cityId = -1;
|
||||||
searchResult = searchResult != null ? searchResult : emptyResult;
|
searchResult = searchResult != null ? searchResult : emptyResult;
|
||||||
res.put(searchResult, results);
|
res.put(searchResult, results);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue