Avoid unnecessary memory allocation/relocation

This commit is contained in:
Chocobo1 2023-06-21 12:46:15 +08:00
parent 1f2a6455b6
commit 03d3552ee0
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
3 changed files with 19 additions and 4 deletions

View file

@ -191,7 +191,7 @@ void Smtp::readyRead()
const int pos = m_buffer.indexOf("\r\n");
if (pos < 0) return; // Loop exit condition
const QByteArray line = m_buffer.left(pos);
m_buffer = m_buffer.mid(pos + 2);
m_buffer.remove(0, (pos + 2));
qDebug() << "Response line:" << line;
// Extract response code
const QByteArray code = line.left(3);