Skip to content

Commit

Permalink
make foreach loop iteration variable as &'s
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed Dec 24, 2023
1 parent 8ee4750 commit 5814eab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion OdbDesignLib/FileModel/Design/AttrListFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Odb::Lib::FileModel::Design
loginfo("checking for extraction...");

std::filesystem::path featuresFilePath;
for (const std::string featuresFilename : ATTRLIST_FILENAMES)
for (const std::string& featuresFilename : ATTRLIST_FILENAMES)

Check warning on line 47 in OdbDesignLib/FileModel/Design/AttrListFile.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

loop variable ‘featuresFilename’ of type ‘const string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]

Check warning on line 47 in OdbDesignLib/FileModel/Design/AttrListFile.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

loop variable ‘featuresFilename’ of type ‘const string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
{
loginfo("trying attrlist file: [" + featuresFilename + "]...");

Expand Down
2 changes: 1 addition & 1 deletion OdbDesignLib/FileModel/Design/ComponentsFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ namespace Odb::Lib::FileModel::Design
loginfo("checking for extraction...");

std::filesystem::path componentsFilePath;
for (const std::string componentsFilename : COMPONENTS_FILENAMES)
for (const std::string& componentsFilename : COMPONENTS_FILENAMES)

Check warning on line 314 in OdbDesignLib/FileModel/Design/ComponentsFile.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

loop variable ‘componentsFilename’ of type ‘const string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]

Check warning on line 314 in OdbDesignLib/FileModel/Design/ComponentsFile.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

loop variable ‘componentsFilename’ of type ‘const string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct]
{
loginfo("trying components file: [" + componentsFilename + "]...");

Expand Down
2 changes: 1 addition & 1 deletion OdbDesignLib/FileModel/Design/FeaturesFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Odb::Lib::FileModel::Design
}

std::filesystem::path featuresFilePath;
for (const std::string featuresFilename : filenames)
for (const std::string& featuresFilename : filenames)
{
loginfo("trying features file: [" + featuresFilename + "]...");

Expand Down

0 comments on commit 5814eab

Please sign in to comment.