Fix exception
This commit is contained in:
parent
9dd0855d5a
commit
d60b22de0c
1 changed files with 7 additions and 2 deletions
|
@ -44,12 +44,17 @@ public class RouteSegmentResult {
|
|||
int end = Math.max(startPointIndex, endPointIndex);
|
||||
float[] res = new float[(end - st + 1) * 2];
|
||||
for (int k = 0; k < res.length / 2; k++) {
|
||||
int ind = reverse ? (2 * (end - k)) : (2 * (k + st));
|
||||
if (k == 0) {
|
||||
res[2 * k] = 0;
|
||||
} else {
|
||||
res[2 * k] = pf[reverse ? (2 * (end - k)) : (2 * (k + st))];
|
||||
if(ind < pf.length) {
|
||||
res[2 * k] = pf[k];
|
||||
}
|
||||
}
|
||||
if(ind < pf.length) {
|
||||
res[2 * k + 1] = pf[ind + 1];
|
||||
}
|
||||
res[2 * k + 1] = pf[reverse ? (2 * (end - k) + 1) : (2 * (k + st) + 1)];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue