[Qt] Avoid a deep copy on the network reply
QByteArray::data() may do a deep copy.
This commit is contained in:
@@ -90,7 +90,7 @@ void HTTPRequest::handleNetworkReply(QNetworkReply *reply)
|
||||
if (bytes.isEmpty()) {
|
||||
response.data = std::make_shared<std::string>();
|
||||
} else {
|
||||
response.data = std::make_shared<std::string>(bytes.data(), bytes.size());
|
||||
response.data = std::make_shared<std::string>(bytes.constData(), bytes.size());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user