diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-01-17 14:08:29 +0100 |
|---|---|---|
| committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-01-17 19:22:24 +0100 |
| commit | 1d43cbfede7d39fefecb39a8a5dbb74a23d7383a (patch) | |
| tree | ae651c5cd645274b2af9701ee6f1ff694dce5b12 /src | |
| parent | aaa198cb5cd8bfcf366a09982a19c0c1c8d1f7a3 (diff) | |
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 <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/tools/qarraydataops.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<Span> &ranges) + void copyRanges(std::initializer_list<Span> ranges) { auto it = this->begin(); std::for_each(ranges.begin(), ranges.end(), [&it](const auto &span) { |
