From 12865c0a2c49596ea22f7e755a672093281978e6 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 29 Feb 2016 23:26:44 +0000 Subject: Make QMediaTimeRange::operator== more efficient and readable by using QList::operator== Change-Id: I4704ffa2432979e3b2752ebefa7c6b48cc7f713b Reviewed-by: Marc Mutz Reviewed-by: Yoann Lopes --- src/multimedia/qmediatimerange.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/multimedia/qmediatimerange.cpp') 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(); } /*! -- cgit v1.2.3