QDirPrivate: pass input QList by cref

Unlike the mutable lvalue reference that was previously used to pass
it suggested, the input is never modified, so pass by const reference.

Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I5659fe5eab4a8953cd36134735e9e8fd9601f530
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2022-08-17 22:27:39 +02:00
parent 84277dda00
commit eef0013086
2 changed files with 2 additions and 2 deletions

View File

@ -276,7 +276,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt
return r < 0;
}
inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l,
inline void QDirPrivate::sortFileList(QDir::SortFlags sort, const QFileInfoList &l,
QStringList *names, QFileInfoList *infos)
{
// names and infos are always empty lists or 0 here

View File

@ -44,7 +44,7 @@ public:
void initFileEngine();
void initFileLists(const QDir &dir) const;
static void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *);
static void sortFileList(QDir::SortFlags, const QFileInfoList &, QStringList *, QFileInfoList *);
static inline QChar getFilterSepChar(const QString &nameFilter);