Use list-initialization more
Fixes a few ugly code pieces I added over the years. Change-Id: I5c06b73e858add04ea184120c6df71720baf9be3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
c38a1b4bb9
commit
dc8bfab82e
@ -954,8 +954,7 @@ QTextStreamPrivate::PaddingResult QTextStreamPrivate::padding(int len) const
|
||||
right = padSize - padSize/2;
|
||||
break;
|
||||
}
|
||||
const PaddingResult result = { left, right };
|
||||
return result;
|
||||
return { left, right };
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -160,8 +160,7 @@ static ParsedDate getDateFromJulianDay(qint64 julianDay)
|
||||
if (year <= 0)
|
||||
--year ;
|
||||
|
||||
const ParsedDate result = { year, month, day };
|
||||
return result;
|
||||
return { year, month, day };
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -311,11 +311,10 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *ciph
|
||||
|
||||
// static
|
||||
inline QSslErrorEntry QSslErrorEntry::fromStoreContext(X509_STORE_CTX *ctx) {
|
||||
QSslErrorEntry result = {
|
||||
return {
|
||||
q_X509_STORE_CTX_get_error(ctx),
|
||||
q_X509_STORE_CTX_get_error_depth(ctx)
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
// ### This list is shared between all threads, and protected by a
|
||||
|
@ -4420,8 +4420,7 @@ QItemViewPaintPairs QAbstractItemViewPrivate::draggablePaintPairs(const QModelIn
|
||||
for (const auto &index : indexes) {
|
||||
const QRect current = q->visualRect(index);
|
||||
if (current.intersects(viewportRect)) {
|
||||
QItemViewPaintPair p = { current, index };
|
||||
ret += p;
|
||||
ret.append({current, index});
|
||||
rect |= current;
|
||||
}
|
||||
}
|
||||
|
@ -663,8 +663,7 @@ QItemViewPaintPairs QListViewPrivate::draggablePaintPairs(const QModelIndexList
|
||||
for (const auto &index : indexes) {
|
||||
if (std::binary_search(visibleIndexes.cbegin(), visibleIndexes.cend(), index)) {
|
||||
const QRect current = q->visualRect(index);
|
||||
QItemViewPaintPair p = { current, index };
|
||||
ret += p;
|
||||
ret.append({current, index});
|
||||
rect |= current;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user