QByteArray: call the out-of-line implementation of assign() for char*

We do the same for QString, via QAnyStringView.

Amends commit 18a2c62c07.

Pick-to: 6.10 6.9 6.8
Change-Id: I9b112758483774d65000fffdac26d775ffba175d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Thiago Macieira 2025-06-20 10:53:27 -07:00
parent 2293fe9de8
commit 231321a91d
1 changed files with 2 additions and 0 deletions

View File

@ -319,6 +319,8 @@ public:
template <typename InputIterator, if_input_iterator<InputIterator> = true>
QByteArray &assign(InputIterator first, InputIterator last)
{
if constexpr (std::is_same_v<InputIterator, iterator> || std::is_same_v<InputIterator, const_iterator>)
return assign(QByteArrayView(first, last));
d.assign(first, last);
if (d.data())
d.data()[d.size] = '\0';