]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Don't reallocate a QByteArray for each contentChecksumType call #5481
authorJocelyn Turcotte <jturcotte@woboq.com>
Thu, 26 Jan 2017 11:17:00 +0000 (12:17 +0100)
committerJocelyn Turcotte <jturcotte@woboq.com>
Thu, 26 Jan 2017 16:13:54 +0000 (17:13 +0100)
src/libsync/checksums.cpp

index af86149513c1422c2448db8585b30ba4a68acece..b8b6ae067781fd855d04517d1bd86638c9093a67 100644 (file)
@@ -111,10 +111,10 @@ bool uploadChecksumEnabled()
 QByteArray contentChecksumType()
 {
     static QByteArray type = qgetenv("OWNCLOUD_CONTENT_CHECKSUM_TYPE");
-    if (!type.isNull()) { // can set to "" to disable checksumming
-        return type;
+    if (type.isNull()) { // can set to "" to disable checksumming
+        type = "SHA1";
     }
-    return "SHA1";
+    return type;
 }
 
 ComputeChecksum::ComputeChecksum(QObject* parent)