summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-07 23:13:17 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-08 15:12:27 +0200
commit9bd287335b2b7a70e116f4ef955e9e12df9009d0 (patch)
tree315fe517a16ea955eeaf20ee2a054121b16ce033 /src/corelib/plugin
parent67c835d201e52156afe3e5ec94772e7872e73743 (diff)
QPluginMetaData: replace manual loop with q20::copy_n
Pick-to: 6.4 Change-Id: I7061b18efd2ff905cc36df41d680c0612a505a76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qplugin.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h
index 61dff6ab53..30f5cbb92f 100644
--- a/src/corelib/plugin/qplugin.h
+++ b/src/corelib/plugin/qplugin.h
@@ -13,6 +13,8 @@
#include <QtCore/qpointer.h>
#include <QtCore/qjsonobject.h>
+#include <QtCore/q20algorithm.h>
+
QT_BEGIN_NAMESPACE
// Used up to Qt 6.2
@@ -42,10 +44,8 @@ struct QPluginMetaData
template <size_t OSize, typename OO, size_t ISize, typename II>
static constexpr void copy(OO (&out)[OSize], II (&in)[ISize])
{
- // std::copy is not constexpr until C++20
static_assert(OSize <= ISize, "Output would not be fully initialized");
- for (size_t i = 0; i < OSize; ++i)
- out[i] = in[i];
+ q20::copy_n(in, OSize, out);
}
static constexpr quint8 archRequirements()