mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: replace Q_FOREACH and foreach by range base for
Q_FOREACH and foreach are anachronisms. Range based for may cause a performance regression: it can lead to a copy of shared containers (one reason why Qt's COW containers are broken). However, as long as there is no user noticeable delay, there is no point in analyzing each case. And also no point in slapping an 'asConst' on every container that is looped over. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
41cb916060
commit
5ac64ab2cd
16 changed files with 32 additions and 35 deletions
|
@ -495,7 +495,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
|||
firstLine = f.readLine().trimmed();
|
||||
|
||||
currColumns = firstLine.split(';');
|
||||
Q_FOREACH (QString columnText, currColumns) {
|
||||
for (const QString &columnText: currColumns) {
|
||||
if (columnText == "Time") {
|
||||
headers.append("Sample time");
|
||||
} else if (columnText == "Depth") {
|
||||
|
@ -613,7 +613,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
|
|||
if (line.length() > 0)
|
||||
columns = line.split(separator);
|
||||
// now try and guess the columns
|
||||
Q_FOREACH (QString columnText, currColumns) {
|
||||
for (QString columnText: currColumns) {
|
||||
count++;
|
||||
/*
|
||||
* We have to skip the conversion of 2 to ₂ for APD Log
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue