Unify brackets for opening blocks with comments
This commit is contained in:
parent
340227016a
commit
79b1eda1ed
28 changed files with 83 additions and 164 deletions
|
|
@ -55,8 +55,7 @@ public final class DirectWeaver extends ByteDataWriter {
|
|||
aboffset = 0;
|
||||
|
||||
int selev = 0;
|
||||
for (int n = 0; n < size; n++) // loop over nodes
|
||||
{
|
||||
for (int n = 0; n < size; n++) { // loop over nodes
|
||||
OsmNode node = nodes[n];
|
||||
int ilon = node.ilon;
|
||||
int ilat = node.ilat;
|
||||
|
|
@ -68,11 +67,9 @@ public final class DirectWeaver extends ByteDataWriter {
|
|||
if (featureId == 0) break;
|
||||
int bitsize = bc.decodeNoisyNumber(5);
|
||||
|
||||
if (featureId == 2) // exceptions to turn-restriction
|
||||
{
|
||||
if (featureId == 2) { // exceptions to turn-restriction
|
||||
trExceptions = (short) bc.decodeBounded(1023);
|
||||
} else if (featureId == 1) // turn-restriction
|
||||
{
|
||||
} else if (featureId == 1) { // turn-restriction
|
||||
TurnRestriction tr = new TurnRestriction();
|
||||
tr.exceptions = trExceptions;
|
||||
trExceptions = 0;
|
||||
|
|
@ -100,8 +97,7 @@ public final class DirectWeaver extends ByteDataWriter {
|
|||
int dlat_remaining;
|
||||
|
||||
boolean isReverse = false;
|
||||
if (nodeIdx != n) // internal (forward-) link
|
||||
{
|
||||
if (nodeIdx != n) { // internal (forward-) link
|
||||
dlon_remaining = nodes[nodeIdx].ilon - ilon;
|
||||
dlat_remaining = nodes[nodeIdx].ilat - ilat;
|
||||
} else {
|
||||
|
|
@ -115,8 +111,7 @@ public final class DirectWeaver extends ByteDataWriter {
|
|||
int linklon = ilon + dlon_remaining;
|
||||
int linklat = ilat + dlat_remaining;
|
||||
aboffset = 0;
|
||||
if (!isReverse) // write geometry for forward links only
|
||||
{
|
||||
if (!isReverse) { // write geometry for forward links only
|
||||
WaypointMatcher matcher = wayTags == null || wayTags.accessType < 2 ? null : waypointMatcher;
|
||||
int ilontarget = ilon + dlon_remaining;
|
||||
int ilattarget = ilat + dlat_remaining;
|
||||
|
|
@ -154,8 +149,7 @@ public final class DirectWeaver extends ByteDataWriter {
|
|||
System.arraycopy(ab, 0, geometry, 0, aboffset);
|
||||
}
|
||||
|
||||
if (nodeIdx != n) // valid internal (forward-) link
|
||||
{
|
||||
if (nodeIdx != n) { // valid internal (forward-) link
|
||||
OsmNode node2 = nodes[nodeIdx];
|
||||
OsmLink link = node.isLinkUnused() ? node : (node2.isLinkUnused() ? node2 : null);
|
||||
if (link == null) {
|
||||
|
|
@ -164,8 +158,7 @@ public final class DirectWeaver extends ByteDataWriter {
|
|||
link.descriptionBitmap = wayTags.data;
|
||||
link.geometry = geometry;
|
||||
node.addLink(link, isReverse, node2);
|
||||
} else // weave external link
|
||||
{
|
||||
} else { // weave external link
|
||||
node.addLink(linklon, linklat, wayTags.data, geometry, hollowNodes, isReverse);
|
||||
node.visitID = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public final class GeometryDecoder {
|
|||
private OsmTransferNode[] cachedNodes;
|
||||
private int nCachedNodes = 128;
|
||||
|
||||
// result-cache
|
||||
// result-cache
|
||||
private OsmTransferNode firstTransferNode;
|
||||
private boolean lastReverse;
|
||||
private byte[] lastGeometry;
|
||||
|
|
@ -47,8 +47,7 @@ public final class GeometryDecoder {
|
|||
olon = trans.ilon;
|
||||
olat = trans.ilat;
|
||||
oselev = trans.selev;
|
||||
if (reverseLink) // reverse chaining
|
||||
{
|
||||
if (reverseLink) { // reverse chaining
|
||||
trans.next = firstTransferNode;
|
||||
firstTransferNode = trans;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -220,8 +220,7 @@ public final class NodesCache {
|
|||
node.parseNodeBody(segment, nodesMap, expCtxWay);
|
||||
}
|
||||
|
||||
if (garbageCollectionEnabled) // garbage collection
|
||||
{
|
||||
if (garbageCollectionEnabled) { // garbage collection
|
||||
cacheSum -= segment.collect(segment.getSize() >> 1); // threshold = 1/2 of size is deleted
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -171,11 +171,9 @@ public class OsmNode extends OsmLink implements OsmPos {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (tn == null) // .. not found, then check the hollow nodes
|
||||
{
|
||||
if (tn == null) { // .. not found, then check the hollow nodes
|
||||
tn = hollowNodes.get(linklon, linklat); // target node
|
||||
if (tn == null) // node not yet known, create a new hollow proxy
|
||||
{
|
||||
if (tn == null) { // node not yet known, create a new hollow proxy
|
||||
tn = new OsmNode(linklon, linklat);
|
||||
tn.setHollow();
|
||||
hollowNodes.put(tn);
|
||||
|
|
@ -231,8 +229,7 @@ public class OsmNode extends OsmLink implements OsmPos {
|
|||
OsmLink l = firstlink;
|
||||
while (l != null) {
|
||||
// if ( l.isReverse( this ) )
|
||||
if (l.n1 != this && l.n1 != null) // isReverse inline
|
||||
{
|
||||
if (l.n1 != this && l.n1 != null) { // isReverse inline
|
||||
OsmLink nl = l.previous;
|
||||
if (nl == link) {
|
||||
l.previous = n;
|
||||
|
|
|
|||
|
|
@ -53,8 +53,7 @@ public final class OsmNodesMap {
|
|||
|
||||
private void cleanupPeninsulas(OsmNode[] nodes) {
|
||||
baseID = lastVisitID++;
|
||||
for (int i = 0; i < nodes.length; i++) // loop over nodes again just for housekeeping
|
||||
{
|
||||
for (int i = 0; i < nodes.length; i++) { // loop over nodes again just for housekeeping
|
||||
OsmNode n = nodes[i];
|
||||
if (n.firstlink != null) {
|
||||
if (n.visitID == 1) {
|
||||
|
|
@ -88,8 +87,7 @@ public final class OsmNodesMap {
|
|||
} else if (minIdSub == 0) {
|
||||
int nodesCreatedUntilHere = nodesCreated;
|
||||
minIdSub = minVisitIdInSubtree(n, t);
|
||||
if (minIdSub > n.visitID) // peninsula ?
|
||||
{
|
||||
if (minIdSub > n.visitID) { // peninsula ?
|
||||
nodesCreated = nodesCreatedUntilHere;
|
||||
n.unlinkLink(l);
|
||||
t.unlinkLink(l);
|
||||
|
|
@ -227,9 +225,8 @@ public final class OsmNodesMap {
|
|||
|
||||
|
||||
public void remove(OsmNode node) {
|
||||
if (node != endNode1 && node != endNode2) // keep endnodes in hollow-map even when loaded
|
||||
{ // (needed for escape analysis)
|
||||
hmap.remove(node);
|
||||
if (node != endNode1 && node != endNode2) { // keep endnodes in hollow-map even when loaded
|
||||
hmap.remove(node); // (needed for escape analysis)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,10 +69,8 @@ final public class PhysicalFile {
|
|||
DataBuffers dataBuffers = new DataBuffers();
|
||||
pf = new PhysicalFile(f, dataBuffers, -1, -1);
|
||||
int div = pf.divisor;
|
||||
for (int lonDegree = 0; lonDegree < 5; lonDegree++) // does'nt really matter..
|
||||
{
|
||||
for (int latDegree = 0; latDegree < 5; latDegree++) // ..where on earth we are
|
||||
{
|
||||
for (int lonDegree = 0; lonDegree < 5; lonDegree++) { // does'nt really matter..
|
||||
for (int latDegree = 0; latDegree < 5; latDegree++) { // ..where on earth we are
|
||||
OsmFile osmf = new OsmFile(pf, lonDegree, latDegree, dataBuffers);
|
||||
if (osmf.hasData())
|
||||
for (int lonIdx = 0; lonIdx < div; lonIdx++)
|
||||
|
|
@ -115,8 +113,7 @@ final public class PhysicalFile {
|
|||
|
||||
if (len == pos) return; // old format o.k.
|
||||
|
||||
if (len < pos + extraLen) // > is o.k. for future extensions!
|
||||
{
|
||||
if (len < pos + extraLen) { // > is o.k. for future extensions!
|
||||
throw new IOException("file of size " + len + " too short, should be " + (pos + extraLen));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue