DataStreamPeer: Optimize the InitData message
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 29 Jan 2014 00:36:49 +0000 (01:36 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 15 Feb 2014 21:01:01 +0000 (22:01 +0100)
commitd1d1e6ef1d2073d629bf54fd8e0d31f647f9cb88
treed8b3cb67ff1231d3dea709ddcfe66308b164ea8f
parent89aa3d278f7b5fac996f0b9480737e5932d54c41
DataStreamPeer: Optimize the InitData message

Since an InitData message consists of the usual message header
(serialized as a QVariantList) followed by a QVariantMap, we can
do what we did in a few other places already; transform the map
into a list of key-value pairs, the keys being UTF-8 strings (as
QByteArrays) instead of QStrings, and append that list to the
rest of the message.

This is just a small optimization, but straightforward to do without
changing protocol semantics or introspecting payloads. And
since we send lots of InitData messages, saving even a few bytes
per message may be worth it.
src/common/protocols/datastream/datastreampeer.cpp