Skip to content

Commit

Permalink
mra/replay/MraVehiclePosHud: Avoid "infinite" loop to loop for non ex…
Browse files Browse the repository at this point in the history
…istence Estimatedstate.
  • Loading branch information
paulosousadias committed Jan 31, 2024
1 parent 0a6033d commit 537eaa8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/java/pt/lsts/neptus/mra/replay/MraVehiclePosHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ protected void loadIndex() {
int msgType = index.getDefinitions().getMessageId("EstimatedState");
int lastIndex = 0;

int indexFirtsMsg = index.getFirstMessageOfType(msgType);
if (indexFirtsMsg < 0) {
return;
}

for (double time = startTime; time < endTime; time++) {
int i = index.getMessageAtOrAfer(msgType, 0xFF, lastIndex, time);
if (i != -1) {
Expand Down

0 comments on commit 537eaa8

Please sign in to comment.