summaryrefslogtreecommitdiffstats
path: root/src/multimedia/qmediatimerange.cpp
diff options
context:
space:
mode:
authorSergio Martins <iamsergio@gmail.com>2016-02-29 23:26:44 +0000
committerYoann Lopes <yoann.lopes@theqtcompany.com>2016-03-01 12:51:55 +0000
commit12865c0a2c49596ea22f7e755a672093281978e6 (patch)
tree89f75e2354f42076d994f7f1d0056c37e4eebfd0 /src/multimedia/qmediatimerange.cpp
parent00569c23eeb31069b48242801305d3db9818c65d (diff)
Make QMediaTimeRange::operator== more efficient and readable
by using QList<QMediaTimeInterval>::operator== Change-Id: I4704ffa2432979e3b2752ebefa7c6b48cc7f713b Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/multimedia/qmediatimerange.cpp')
-rw-r--r--src/multimedia/qmediatimerange.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/multimedia/qmediatimerange.cpp b/src/multimedia/qmediatimerange.cpp
index 7739c704f..700dcd087 100644
--- a/src/multimedia/qmediatimerange.cpp
+++ b/src/multimedia/qmediatimerange.cpp
@@ -665,16 +665,7 @@ bool QMediaTimeRange::contains(qint64 time) const
*/
bool operator==(const QMediaTimeRange &a, const QMediaTimeRange &b)
{
- if (a.intervals().count() != b.intervals().count())
- return false;
-
- for (int i = 0; i < a.intervals().count(); i++)
- {
- if(a.intervals()[i] != b.intervals()[i])
- return false;
- }
-
- return true;
+ return a.intervals() == b.intervals();
}
/*!