Ticket #13363: 0001-ReadStringListReal-move-construction-of-QByteArray-u.patch

File 0001-ReadStringListReal-move-construction-of-QByteArray-u.patch, 1.3 KB (added by ijc, 14 months ago)
  • mythtv/libs/libmythbase/mythsocket.cpp

    From ab5810136409eb0989a710503da7d09910caab07 Mon Sep 17 00:00:00 2001
    From: Ian Campbell <ijc@hellion.org.uk>
    Date: Sat, 22 Dec 2018 13:52:37 +0000
    Subject: [PATCH 1/2] ReadStringListReal: move construction of QByteArray under
     log level check
    
    It is only used for the log message, so no need to construct it otherwise.
    
    Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
    ---
     mythtv/libs/libmythbase/mythsocket.cpp | 12 ++++++------
     1 file changed, 6 insertions(+), 6 deletions(-)
    
    diff --git a/mythtv/libs/libmythbase/mythsocket.cpp b/mythtv/libs/libmythbase/mythsocket.cpp
    index 69cba58448..c4dfd7258e 100644
    a b void MythSocket::ReadStringListReal( 
    938938
    939939    QString str = QString::fromUtf8(utf8.data());
    940940
    941     QByteArray payload;
    942     payload = payload.setNum(str.length());
    943     payload += "        ";
    944     payload.truncate(8);
    945     payload += str;
    946 
    947941    if (VERBOSE_LEVEL_CHECK(VB_NETWORK, LOG_INFO))
    948942    {
     943        QByteArray payload;
     944        payload = payload.setNum(str.length());
     945        payload += "        ";
     946        payload.truncate(8);
     947        payload += utf8.data();
     948
    949949        QString msg = QString("read  <- %1 %2")
    950950            .arg(m_tcpSocket->socketDescriptor(), 2)
    951951            .arg(payload.data());