qarraydataops.h: Pass initializer_list by value in copyRanges

initializer_list is supposed to be cheap to copy, and passing by value
will avoid one further indirection (though the compiler can probably see
through it, anyway).

Change-Id: I8ffbf5de4d8cf2c85f4cff76ef63d6cdeac4db5a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1d43cbfede7d39fefecb39a8a5dbb74a23d7383a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Fabian Kosmale 2023-01-17 14:08:29 +01:00 committed by Qt Cherry-pick Bot
parent 761d22bb07
commit 157126fa57

View File

@ -215,7 +215,7 @@ public:
struct Span { T *begin; T *end; };
void copyRanges(const std::initializer_list<Span> &ranges)
void copyRanges(std::initializer_list<Span> ranges)
{
auto it = this->begin();
std::for_each(ranges.begin(), ranges.end(), [&it](const auto &span) {