From bb02b9696e9b8c73cc00a1535d93b99c3a3fd4d0 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 29 Jun 2020 14:29:51 +0200 Subject: [PATCH] Q*Iterable::const_iterator: pass by const reference The iterators are quite heavy objects (>100bytes), don't pass them by value. Change-Id: I4c9d1f64d14419a35bd067884d7e8bca2589f9b9 Reviewed-by: Lars Knoll --- src/corelib/kernel/qvariant.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index a80321b7d4..b5e9deedf0 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -626,7 +626,7 @@ public: const_iterator &operator-=(int j); const_iterator operator+(int j) const; const_iterator operator-(int j) const; - friend inline const_iterator operator+(int j, const_iterator k) { return k + j; } + friend inline const_iterator operator+(int j, const const_iterator &k) { return k + j; } }; friend struct const_iterator; @@ -680,7 +680,7 @@ public: const_iterator &operator-=(int j); const_iterator operator+(int j) const; const_iterator operator-(int j) const; - friend inline const_iterator operator+(int j, const_iterator k) { return k + j; } + friend inline const_iterator operator+(int j, const const_iterator &k) { return k + j; } }; friend struct const_iterator;