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

JDWinMain: Unite if-statement blocks for same condition #382

Merged

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jul 4, 2020

隣り合うif文が同じ条件であるとcppcheckに指摘されたためブロックをまとめます。

cppcheckのレポート

src/winmain.cpp:281:9: style: The if condition is the same as the previous if condition [duplicateCondition]
    if( m_cancel_state_event ) return Gtk::Window::on_window_state_event( event );
        ^
src/winmain.cpp:277:9: note: First condition
    if( m_cancel_state_event ) std::cout << "cancel\n";
        ^
src/winmain.cpp:281:9: note: Second condition
    if( m_cancel_state_event ) return Gtk::Window::on_window_state_event( event );
        ^
src/winmain.cpp:295:9: style: The if condition is the same as the previous if condition [duplicateCondition]
    if( m_cancel_state_event ) return Gtk::Window::on_configure_event( event );
        ^
src/winmain.cpp:291:9: note: First condition
    if( m_cancel_state_event ) std::cout << "cancel\n";
        ^
src/winmain.cpp:295:9: note: Second condition
    if( m_cancel_state_event ) return Gtk::Window::on_configure_event( event );
        ^

隣り合うif文が同じ条件であるとcppcheckに指摘されたためブロックを
まとめます。

cppcheckのレポート
```
src/winmain.cpp:281:9: style: The if condition is the same as the previous if condition [duplicateCondition]
    if( m_cancel_state_event ) return Gtk::Window::on_window_state_event( event );
        ^
src/winmain.cpp:277:9: note: First condition
    if( m_cancel_state_event ) std::cout << "cancel\n";
        ^
src/winmain.cpp:281:9: note: Second condition
    if( m_cancel_state_event ) return Gtk::Window::on_window_state_event( event );
        ^
src/winmain.cpp:295:9: style: The if condition is the same as the previous if condition [duplicateCondition]
    if( m_cancel_state_event ) return Gtk::Window::on_configure_event( event );
        ^
src/winmain.cpp:291:9: note: First condition
    if( m_cancel_state_event ) std::cout << "cancel\n";
        ^
src/winmain.cpp:295:9: note: Second condition
    if( m_cancel_state_event ) return Gtk::Window::on_configure_event( event );
        ^
```
@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 38c83d6 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 jdwinmain-unite-if-stmt-block-for-same-cond branch July 4, 2020 07:52
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