From 0f994e2da6133d79a12cf8ae43b34e2c0df05421 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 28 Jan 2021 17:21:32 +0200 Subject: [PATCH] Small refactoring --- .../osmand/plus/wikivoyage/data/TravelLocalDataHelper.java | 4 ++-- .../src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java index a95438a77e..c2ccc442c3 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelLocalDataHelper.java @@ -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; } } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index ab9e926c10..294cf2cd13 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -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 articles; - if (Algorithms.objectEquals(amenity.getSubType(), ROUTE_TRACK)) { + if (ROUTE_TRACK.equals(amenity.getSubType())) { articles = readRoutePoint(file, amenity); } else { articles = readArticles(file, amenity);