Make simpler

This commit is contained in:
Victor Shcherb 2020-06-19 13:30:07 +02:00
parent 6270e202fb
commit 37465266aa

View file

@ -694,11 +694,10 @@ public class BinaryMapPoiReaderAdapter {
StringBuilder retValue = new StringBuilder(); StringBuilder retValue = new StringBuilder();
PoiCategory amenityType = null; PoiCategory amenityType = null;
LinkedList<String> textTags = null; LinkedList<String> textTags = null;
boolean isForbidden = false;
while (true) { while (true) {
int t = codedIS.readTag(); int t = codedIS.readTag();
int tag = WireFormat.getTagFieldNumber(t); 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()); codedIS.skipRawBytes(codedIS.getBytesUntilLimit());
return null; return null;
} }
@ -773,8 +772,8 @@ public class BinaryMapPoiReaderAdapter {
} }
} }
subtype = poiTypes.replaceDeprecatedSubtype(type, subtype); subtype = poiTypes.replaceDeprecatedSubtype(type, subtype);
isForbidden = poiTypes.isKeyNameForbidden(subtype); boolean isForbidden = poiTypes.isKeyNameForbidden(subtype);
if (req.poiTypeFilter == null || req.poiTypeFilter.accept(type, subtype)) { if (!isForbidden && (req.poiTypeFilter == null || req.poiTypeFilter.accept(type, subtype))) {
if (amenityType == null) { if (amenityType == null) {
amenityType = type; amenityType = type;
am.setSubType(subtype); am.setSubType(subtype);