From 1d43cbfede7d39fefecb39a8a5dbb74a23d7383a Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 17 Jan 2023 14:08:29 +0100 Subject: [PATCH] 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). Pick-to: 6.5 Change-Id: I8ffbf5de4d8cf2c85f4cff76ef63d6cdeac4db5a Reviewed-by: Ahmad Samir Reviewed-by: Marc Mutz --- src/corelib/tools/qarraydataops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index d50c74f2c20..9b29b8a1807 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -215,7 +215,7 @@ public: struct Span { T *begin; T *end; }; - void copyRanges(const std::initializer_list &ranges) + void copyRanges(std::initializer_list ranges) { auto it = this->begin(); std::for_each(ranges.begin(), ranges.end(), [&it](const auto &span) {