Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use STL Algorithm for raw loops #335

Merged
merged 1 commit into from Jun 13, 2020

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jun 13, 2020

生のループに対してSTLアルゴリズム関数を使用することをcppcheckに指摘されたため修正します。

cppcheckのレポート

src/jdlib/confloader.cpp:72:18: style: Consider using std::accumulate algorithm instead of a raw loop. [useStlAlgorithm]
        str_conf += conf.name + " = " + conf.value + "\n";
                 ^
src/jdlib/confloader.cpp:92:33: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
        if( conf.name == name ) {
                                ^
src/xml/document.cpp:123:9: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
        {
        ^

生のループに対してSTLアルゴリズム関数を使用することをcppcheckに
指摘されたため修正します。

cppcheckのレポート
```
src/jdlib/confloader.cpp:72:18: style: Consider using std::accumulate algorithm instead of a raw loop. [useStlAlgorithm]
        str_conf += conf.name + " = " + conf.value + "\n";
                 ^
src/jdlib/confloader.cpp:92:33: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
        if( conf.name == name ) {
                                ^
src/xml/document.cpp:123:9: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]
        {
        ^
```
@ma8ma ma8ma added the refactoring コードの整理 (バグ修正でも機能変更でもない) label Jun 13, 2020
@ma8ma ma8ma merged commit 9232fdf into JDimproved:master Jun 13, 2020
@ma8ma ma8ma added this to Done in State of JDim-v0.3.0+ via automation Jun 13, 2020
@ma8ma ma8ma deleted the use-stl-algorithm-for-loop branch June 13, 2020 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring コードの整理 (バグ修正でも機能変更でもない)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant