forked from qt-creator/qt-creator
Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1286,7 +1286,7 @@ static QList<FileData> readGitPatch(QStringView patch, bool *ok, QFutureInterfac
|
||||
QList<FileData> fileDataList;
|
||||
readOk = false;
|
||||
int i = 0;
|
||||
for (const auto &patchInfo : qAsConst(patches)) {
|
||||
for (const auto &patchInfo : std::as_const(patches)) {
|
||||
if (jobController) {
|
||||
if (jobController->isCanceled())
|
||||
return {};
|
||||
|
||||
@@ -432,7 +432,7 @@ UnifiedDiffOutput UnifiedDiffData::diffOutput(QFutureInterface<void> &fi, int pr
|
||||
int i = 0;
|
||||
const int count = input.m_contextFileData.size();
|
||||
|
||||
for (const FileData &fileData : qAsConst(input.m_contextFileData)) {
|
||||
for (const FileData &fileData : std::as_const(input.m_contextFileData)) {
|
||||
const QString leftFileInfo = "--- " + fileData.fileInfo[LeftSide].fileName + '\n';
|
||||
const QString rightFileInfo = "+++ " + fileData.fileInfo[RightSide].fileName + '\n';
|
||||
output.diffData.m_fileInfo[blockNumber] = fileData.fileInfo;
|
||||
|
||||
Reference in New Issue
Block a user