Small refactoring

This commit is contained in:
Dima-1 2021-01-28 17:21:32 +02:00
parent cbebccb123
commit 0f994e2da6
2 changed files with 3 additions and 3 deletions

View file

@ -143,8 +143,8 @@ public class TravelLocalDataHelper {
@Nullable
private TravelArticle getArticle(String title, String lang) {
for (TravelArticle article : savedArticles) {
if (article.title != null && article.title.equals(title)
&& (article.lang != null && article.lang.equals(lang) || article.lang == null && lang == null)) {
if (Algorithms.stringsEqual(article.title, title)
&& Algorithms.stringsEqual(article.lang, lang)) {
return article;
}
}

View file

@ -165,7 +165,7 @@ public class TravelObfHelper implements TravelHelper {
private TravelArticle cacheTravelArticles(File file, Amenity amenity, String lang, boolean readPoints, @Nullable GpxReadCallback callback) {
TravelArticle article = null;
Map<String, TravelArticle> articles;
if (Algorithms.objectEquals(amenity.getSubType(), ROUTE_TRACK)) {
if (ROUTE_TRACK.equals(amenity.getSubType())) {
articles = readRoutePoint(file, amenity);
} else {
articles = readArticles(file, amenity);