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

EditTextView: Fix redundant initialization #380

Merged

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jul 4, 2020

無意味な変数初期化を行っているとcppcheckの指摘されたため修正します。

cppcheckのレポート

src/skeleton/editview.cpp:571:24: style: Redundant initialization for 'nlpos'. The initialized value is overwritten before it is read. [redundantInitialization]
        while( ( nlpos = text.rfind( "\n", rpos ) ) != std::string::npos )
                       ^
src/skeleton/editview.cpp:568:22: note: nlpos is initialized
        size_t nlpos = std::string::npos;
                     ^
src/skeleton/editview.cpp:571:24: note: nlpos is overwritten
        while( ( nlpos = text.rfind( "\n", rpos ) ) != std::string::npos )
                       ^

無意味な変数初期化を行っているとcppcheckの指摘されたため修正します。

cppcheckのレポート
```
src/skeleton/editview.cpp:571:24: style: Redundant initialization for 'nlpos'. The initialized value is overwritten before it is read. [redundantInitialization]
        while( ( nlpos = text.rfind( "\n", rpos ) ) != std::string::npos )
                       ^
src/skeleton/editview.cpp:568:22: note: nlpos is initialized
        size_t nlpos = std::string::npos;
                     ^
src/skeleton/editview.cpp:571:24: note: nlpos is overwritten
        while( ( nlpos = text.rfind( "\n", rpos ) ) != std::string::npos )
                       ^
```
@ma8ma ma8ma added the refactoring コードの整理 (バグ修正でも機能変更でもない) label Jul 4, 2020
@ma8ma ma8ma added this to In progress in State of JDim-v0.3.0+ via automation Jul 4, 2020
@ma8ma ma8ma merged commit 37427c5 into JDimproved:master Jul 4, 2020
State of JDim-v0.3.0+ automation moved this from In progress to Done Jul 4, 2020
@ma8ma ma8ma deleted the edittreeview-fix-redundant-initialization branch July 4, 2020 07:28
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