From 1fb6aad50fb51870c144f8694a9532a2d2403c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 26 Sep 2020 12:23:41 +0200 Subject: [PATCH] A better segment copy --- src/data/track.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/data/track.cpp b/src/data/track.cpp index 782b5743..d66e3544 100644 --- a/src/data/track.cpp +++ b/src/data/track.cpp @@ -95,9 +95,11 @@ Track::Track(const TrackData &data) : _pause(0) if (_useSegments) _data = data; else { - _data.append(SegmentData()); - for (int i = 0; i < data.size(); i++) - _data[0] << data.at(i); + if (!data.isEmpty()) { + _data.append(data.first()); + for (int i = 1; i < data.size(); i++) + _data.first() << data.at(i); + } } for (int i = 0; i < _data.size(); i++) {