correct starting offset

This commit is contained in:
RickyRister 2026-08-08 22:16:26 -07:00
parent d7b5de9c73
commit cb52cdd343

View file

@ -177,7 +177,7 @@ void ReplayManager::handleSkipEmptySection()
} }
// find most recent meaningful event // find most recent meaningful event
int prevEvent = currentEvent; int prevEvent = std::max(0, currentEvent - 1);
for (; prevEvent > 0 && !hasMeaningfulEvent(replay->event_list(prevEvent)); --prevEvent) { for (; prevEvent > 0 && !hasMeaningfulEvent(replay->event_list(prevEvent)); --prevEvent) {
} }
@ -187,7 +187,7 @@ void ReplayManager::handleSkipEmptySection()
} }
// find next earliest meaningful event // find next earliest meaningful event
int nextEvent = currentEvent + 1; int nextEvent = currentEvent;
for (; nextEvent < replayTimeline.size() - 1 && !hasMeaningfulEvent(replay->event_list(nextEvent)); ++nextEvent) { for (; nextEvent < replayTimeline.size() - 1 && !hasMeaningfulEvent(replay->event_list(nextEvent)); ++nextEvent) {
} }