Mapsforge: remove MapDatabase.readZoomTable redundant checks, fixes #357
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2010, 2011, 2012 mapsforge.org
|
||||
* Copyright 2013, 2014 Hannes Janetzek
|
||||
* Copyright 2016 devemux86
|
||||
* Copyright 2016-2017 devemux86
|
||||
* Copyright 2016 Andrey Novikov
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
@@ -44,8 +44,7 @@ import static org.oscim.tiling.QueryResult.SUCCESS;
|
||||
/**
|
||||
* A class for reading binary map files.
|
||||
*
|
||||
* @see <a
|
||||
* href="http://code.google.com/p/mapsforge/wiki/SpecificationBinaryMapFile">Specification</a>
|
||||
* @see <a href="http://code.google.com/p/mapsforge/wiki/SpecificationBinaryMapFile">Specification</a>
|
||||
*/
|
||||
public class MapDatabase implements ITileDataSource {
|
||||
/**
|
||||
@@ -83,12 +82,6 @@ public class MapDatabase implements ITileDataSource {
|
||||
*/
|
||||
private static final int MAXIMUM_WAY_NODES_SEQUENCE_LENGTH = 8192;
|
||||
|
||||
/**
|
||||
* Maximum number of map objects in the zoom table which is considered as
|
||||
* valid.
|
||||
*/
|
||||
private static final int MAXIMUM_ZOOM_TABLE_OBJECTS = 65536 * 2;
|
||||
|
||||
/**
|
||||
* Bitmask for the optional POI feature "elevation".
|
||||
*/
|
||||
@@ -924,24 +917,6 @@ public class MapDatabase implements ITileDataSource {
|
||||
cumulatedNumberOfPois += mReadBuffer.readUnsignedInt();
|
||||
cumulatedNumberOfWays += mReadBuffer.readUnsignedInt();
|
||||
|
||||
if (cumulatedNumberOfPois < 0
|
||||
|| cumulatedNumberOfPois > MAXIMUM_ZOOM_TABLE_OBJECTS) {
|
||||
log.warn("invalid cumulated number of POIs in row " + row + ' '
|
||||
+ cumulatedNumberOfPois);
|
||||
if (mDebugFile) {
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
return null;
|
||||
} else if (cumulatedNumberOfWays < 0
|
||||
|| cumulatedNumberOfWays > MAXIMUM_ZOOM_TABLE_OBJECTS) {
|
||||
log.warn("invalid cumulated number of ways in row " + row + ' '
|
||||
+ cumulatedNumberOfWays);
|
||||
if (mTileSource.fileInfo.debugFile) {
|
||||
log.warn(DEBUG_SIGNATURE_BLOCK + mSignatureBlock);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
zoomTable[row][0] = cumulatedNumberOfPois;
|
||||
zoomTable[row][1] = cumulatedNumberOfWays;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user