Skip to content

Commit

Permalink
Use initializer in if claues.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 31, 2024
1 parent 4f229ad commit 8a961b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ImportXlsx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ std::pair<bool, QStringList> ImportXlsx::getColumnNames(
if (!isSheetNameValid(getSheetNames().second, sheetName))
return {false, {}};

const auto it{columnNames_.constFind(sheetName)};
if ((it == columnNames_.constEnd()) && (!analyzeSheet(sheetName)))
if (const auto it{columnNames_.constFind(sheetName)};
(it == columnNames_.constEnd()) && (!analyzeSheet(sheetName)))
return {false, {}};

return {true, columnNames_.value(sheetName)};
Expand Down Expand Up @@ -225,8 +225,7 @@ bool ImportXlsx::moveToSecondRow(QuaZipFile& zipFile,
std::pair<bool, unsigned int> ImportXlsx::getCount(
const QString& sheetName, const QHash<QString, unsigned int>& countMap)
{
const auto it{countMap.find(sheetName)};
if (it != countMap.end())
if (const auto it{countMap.find(sheetName)}; it != countMap.end())
return {true, it.value()};

if (!isCommonDataOk())
Expand Down

0 comments on commit 8a961b4

Please sign in to comment.