summaryrefslogtreecommitdiffstats
path: root/src/track
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-07-12 18:58:22 +0200
committerUwe Klotz <uklotz@mixxx.org>2020-07-12 18:59:06 +0200
commit72b6b645494dd39fe53ea5a219aa84d1cdb76293 (patch)
treefccd92df87941e90c2dda36e3f5a97b0eaea812e /src/track
parent69a347aec59787185ac6f5fb40124ee6b67b3ca3 (diff)
Avoid unneeded locking
Diffstat (limited to 'src/track')
-rw-r--r--src/track/track.cpp5
-rw-r--r--src/track/track.h5
2 files changed, 4 insertions, 6 deletions
diff --git a/src/track/track.cpp b/src/track/track.cpp
index 8a4c321681..41d8984282 100644
--- a/src/track/track.cpp
+++ b/src/track/track.cpp
@@ -877,11 +877,6 @@ void Track::removeCuesOfType(mixxx::CueType type) {
}
}
-QList<CuePointer> Track::getCuePoints() const {
- QMutexLocker lock(&m_qMutex);
- return m_cuePoints;
-}
-
void Track::setCuePoints(const QList<CuePointer>& cuePoints) {
// While this method could be called from any thread,
// associated Cue objects should always live on the
diff --git a/src/track/track.h b/src/track/track.h
index 8d4f8e33a5..24a3466217 100644
--- a/src/track/track.h
+++ b/src/track/track.h
@@ -268,7 +268,10 @@ class Track : public QObject {
CuePointer findCueById(int id) const;
void removeCue(const CuePointer& pCue);
void removeCuesOfType(mixxx::CueType);
- QList<CuePointer> getCuePoints() const;
+ QList<CuePointer> getCuePoints() const {
+ // Copying implicitly shared collections is thread-safe
+ return m_cuePoints;
+ }
void setCuePoints(const QList<CuePointer>& cuePoints);