From 37465266aaf556b0a1e6d4e4244ebd0955c89414 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 19 Jun 2020 13:30:07 +0200 Subject: [PATCH] Make simpler --- .../java/net/osmand/binary/BinaryMapPoiReaderAdapter.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java index d279d72028..82a730ed77 100644 --- a/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java +++ b/OsmAnd-java/src/main/java/net/osmand/binary/BinaryMapPoiReaderAdapter.java @@ -694,11 +694,10 @@ public class BinaryMapPoiReaderAdapter { StringBuilder retValue = new StringBuilder(); PoiCategory amenityType = null; LinkedList textTags = null; - boolean isForbidden = false; while (true) { int t = codedIS.readTag(); int tag = WireFormat.getTagFieldNumber(t); - if (amenityType == null && (tag > OsmandOdb.OsmAndPoiBoxDataAtom.CATEGORIES_FIELD_NUMBER || tag == 0) || isForbidden) { + if (amenityType == null && (tag > OsmandOdb.OsmAndPoiBoxDataAtom.CATEGORIES_FIELD_NUMBER || tag == 0)) { codedIS.skipRawBytes(codedIS.getBytesUntilLimit()); return null; } @@ -773,8 +772,8 @@ public class BinaryMapPoiReaderAdapter { } } subtype = poiTypes.replaceDeprecatedSubtype(type, subtype); - isForbidden = poiTypes.isKeyNameForbidden(subtype); - if (req.poiTypeFilter == null || req.poiTypeFilter.accept(type, subtype)) { + boolean isForbidden = poiTypes.isKeyNameForbidden(subtype); + if (!isForbidden && (req.poiTypeFilter == null || req.poiTypeFilter.accept(type, subtype))) { if (amenityType == null) { amenityType = type; am.setSubType(subtype);