graesslin added inline comments.

INLINE COMMENTS
> fvogt wrote in client.cpp:1428
> Why not directly `QString::fromUtf8(reply.name, reply.name_len)` here? It 
> would save one unnecessary copy. Alternatively, 
> `QByteArray::fromRawData(reply.name, reply.name_len)`, but that's more 
> verbose.

fromRawData is dangerous as we delete the data with the wipe call again. That's 
why I didn't use it. QString::fromUtf8 is something I didn't use as QString 
from ascii is discouraged and can result in compile error depending on the 
compile flags.

So in short: the copy is intended.

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D7046

To: graesslin, #kwin, #plasma
Cc: fvogt, broulik, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas

Reply via email to