mirror of https://github.com/qt/qtbase.git
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:
parent
2293fe9de8
commit
231321a91d
|
@ -319,6 +319,8 @@ public:
|
||||||
template <typename InputIterator, if_input_iterator<InputIterator> = true>
|
template <typename InputIterator, if_input_iterator<InputIterator> = true>
|
||||||
QByteArray &assign(InputIterator first, InputIterator last)
|
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);
|
d.assign(first, last);
|
||||||
if (d.data())
|
if (d.data())
|
||||||
d.data()[d.size] = '\0';
|
d.data()[d.size] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue