OSDN Git Service

combine common return case in QByteArray::repeated()
authorIvailo Monev <xakepa10@laimg.moc>
Wed, 17 Jul 2019 13:53:58 +0000 (13:53 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Wed, 17 Jul 2019 13:53:58 +0000 (13:53 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/tools/qbytearray.cpp

index e2e2bf3..1a7e776 100644 (file)
@@ -2249,12 +2249,10 @@ QList<QByteArray> QByteArray::split(char sep) const
 */
 QByteArray QByteArray::repeated(const int times) const
 {
-    if (d->size == 0)
+    if (d->size == 0 || times == 1)
         return *this;
 
-    if (times <= 1) {
-        if (times == 1)
-            return *this;
+    if (times < 1) {
         return QByteArray();
     }