Fixing a bug that crashed the daemon once in a while.
This commit is contained in:
parent
d5cb1fa15f
commit
922c218394
@ -155,9 +155,10 @@ public:
|
|||||||
bool foundNode = false;
|
bool foundNode = false;
|
||||||
_Coordinate startCoord(100000*(lat2y(static_cast<double>(location.lat)/100000.)), location.lon);
|
_Coordinate startCoord(100000*(lat2y(static_cast<double>(location.lat)/100000.)), location.lon);
|
||||||
/** search for point on edge close to source */
|
/** search for point on edge close to source */
|
||||||
unsigned fileIndex = GetFileIndexForLatLon(startCoord.lat, startCoord.lon);
|
const unsigned fileIndex = GetFileIndexForLatLon(startCoord.lat, startCoord.lon);
|
||||||
std::vector<_GridEdge> candidates;
|
std::vector<_GridEdge> candidates;
|
||||||
for(int j = -32768; (j < (32768+1)) && (fileIndex != UINT_MAX); j+=32768) {
|
const int lowerBoundForLoop = (fileIndex < 32768 ? 0 : -32768);
|
||||||
|
for(int j = lowerBoundForLoop; (j < (32768+1)) && (fileIndex != UINT_MAX); j+=32768) {
|
||||||
for(int i = -1; i < 2; ++i){
|
for(int i = -1; i < 2; ++i){
|
||||||
GetContentsOfFileBucketEnumerated(fileIndex+i+j, candidates);
|
GetContentsOfFileBucketEnumerated(fileIndex+i+j, candidates);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user