From 0be66296cdbd7fbabc1065b5ac1425e359410ab6 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Thu, 15 Dec 2016 07:28:54 -0500 Subject: [PATCH] Sort labels after warping time, just in case... ... Time warping functions should be nondecreasing, but let's not assume so. If not, the insertion sort just takes linear time to check that there are no disorders. --- src/LabelTrack.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/LabelTrack.cpp b/src/LabelTrack.cpp index 59204bcc8..57a22d7ae 100644 --- a/src/LabelTrack.cpp +++ b/src/LabelTrack.cpp @@ -266,6 +266,10 @@ void LabelTrack::WarpLabels(const TimeWarper &warper) { warper.Warp(labelStruct.getT0()), warper.Warp(labelStruct.getT1())); } + + // This should not be needed, assuming the warper is nondecreasing, but + // let's not assume too much. + SortLabels(); } void LabelTrack::ResetFlags()