Skip to content

Commit

Permalink
Explain the purpose of the key in m_marksToRender
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Jul 17, 2023
1 parent 9f045d4 commit 5ddfef2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/widget/woverview.cpp
Expand Up @@ -434,6 +434,9 @@ void WOverview::updateCues(const QList<CuePointer> &loadedCues) {
if (pMark->isValid() && pMark->isVisible()) {
double samplePosition = pMark->getSamplePosition();
if (samplePosition != Cue::kNoPosition) {
// Create a stable key for sorting, because the WaveformMark's samplePosition is a
// ControlObject which can change at any time by other threads. Such a change causes
// another updateCues() call, rebuilding m_marksToRender.
auto key = WaveformMarkSortKey(samplePosition, pMark->getHotCue());
m_marksToRender.emplace(key, pMark);
}
Expand Down

0 comments on commit 5ddfef2

Please sign in to comment.