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

Remove unnecessary condition for assigning value #338

Merged

Commits on Jun 13, 2020

  1. Remove unnecessary condition for assigning value

    条件に関係なく代入の結果と同じになるとcppcheckに指摘されたため
    代入の条件文を削除します。
    
    cppcheckのレポート
    ```
    src/article/drawareabase.cpp:5442:28: style: The statement 'if (m_scrollinfo.x!=m_x_pointer) m_scrollinfo.x=m_x_pointer' is logically equivalent to 'm_scrollinfo.x=m_x_pointer'. [duplicateConditionalAssign]
            if( m_scrollinfo.x != m_x_pointer ) m_scrollinfo.x = m_x_pointer;
                               ^
    src/article/drawareabase.cpp:5442:60: note: Assignment 'm_scrollinfo.x=m_x_pointer'
            if( m_scrollinfo.x != m_x_pointer ) m_scrollinfo.x = m_x_pointer;
                                                               ^
    src/article/drawareabase.cpp:5442:28: note: Condition 'm_scrollinfo.x!=m_x_pointer' is redundant
            if( m_scrollinfo.x != m_x_pointer ) m_scrollinfo.x = m_x_pointer;
                               ^
    src/article/drawareabase.cpp:5443:28: style: The statement 'if (m_scrollinfo.y!=m_y_pointer) m_scrollinfo.y=m_y_pointer' is logically equivalent to 'm_scrollinfo.y=m_y_pointer'. [duplicateConditionalAssign]
            if( m_scrollinfo.y != m_y_pointer ) m_scrollinfo.y = m_y_pointer;
                               ^
    src/article/drawareabase.cpp:5443:60: note: Assignment 'm_scrollinfo.y=m_y_pointer'
            if( m_scrollinfo.y != m_y_pointer ) m_scrollinfo.y = m_y_pointer;
                                                               ^
    src/article/drawareabase.cpp:5443:28: note: Condition 'm_scrollinfo.y!=m_y_pointer' is redundant
            if( m_scrollinfo.y != m_y_pointer ) m_scrollinfo.y = m_y_pointer;
                               ^
    src/dbtree/frontloader.cpp:37:24: style: The statement 'if (m_url_boadbase!=url_boardbase) m_url_boadbase=url_boardbase' is logically equivalent to 'm_url_boadbase=url_boardbase'. [duplicateConditionalAssign]
        if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                           ^
    src/dbtree/frontloader.cpp:37:58: note: Assignment 'm_url_boadbase=url_boardbase'
        if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                                                             ^
    src/dbtree/frontloader.cpp:37:24: note: Condition 'm_url_boadbase!=url_boardbase' is redundant
        if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                           ^
    src/dbtree/ruleloader.cpp:66:28: style: The statement 'if (m_url_boadbase!=url_boardbase) m_url_boadbase=url_boardbase' is logically equivalent to 'm_url_boadbase=url_boardbase'. [duplicateConditionalAssign]
            if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                               ^
    src/dbtree/ruleloader.cpp:66:62: note: Assignment 'm_url_boadbase=url_boardbase'
            if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                                                                 ^
    src/dbtree/ruleloader.cpp:66:28: note: Condition 'm_url_boadbase!=url_boardbase' is redundant
            if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                               ^
    src/dbtree/settingloader.cpp:68:28: style: The statement 'if (m_url_boadbase!=url_boardbase) m_url_boadbase=url_boardbase' is logically equivalent to 'm_url_boadbase=url_boardbase'. [duplicateConditionalAssign]
            if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                               ^
    src/dbtree/settingloader.cpp:68:62: note: Assignment 'm_url_boadbase=url_boardbase'
            if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                                                                 ^
    src/dbtree/settingloader.cpp:68:28: note: Condition 'm_url_boadbase!=url_boardbase' is redundant
            if( m_url_boadbase != url_boardbase ) m_url_boadbase = url_boardbase;
                               ^
    src/skeleton/edittreeview.cpp:69:23: style: The statement 'if (type!=TYPE_BOARD) type=TYPE_BOARD' is logically equivalent to 'type=TYPE_BOARD'. [duplicateConditionalAssign]
            else if( type != TYPE_BOARD ) type = TYPE_BOARD;
                          ^
    src/skeleton/edittreeview.cpp:69:44: note: Assignment 'type=TYPE_BOARD'
            else if( type != TYPE_BOARD ) type = TYPE_BOARD;
                                               ^
    src/skeleton/edittreeview.cpp:69:23: note: Condition 'type!=TYPE_BOARD' is redundant
            else if( type != TYPE_BOARD ) type = TYPE_BOARD;
                          ^
    src/skeleton/edittreeview.cpp:75:23: style: The statement 'if (type!=TYPE_THREAD) type=TYPE_THREAD' is logically equivalent to 'type=TYPE_THREAD'. [duplicateConditionalAssign]
            else if( type != TYPE_THREAD ) type = TYPE_THREAD;
                          ^
    src/skeleton/edittreeview.cpp:75:45: note: Assignment 'type=TYPE_THREAD'
            else if( type != TYPE_THREAD ) type = TYPE_THREAD;
                                                ^
    src/skeleton/edittreeview.cpp:75:23: note: Condition 'type!=TYPE_THREAD' is redundant
            else if( type != TYPE_THREAD ) type = TYPE_THREAD;
                          ^
    ```
    ma8ma committed Jun 13, 2020
    Configuration menu
    Copy the full SHA
    3c8b2c2 View commit details
    Browse the repository at this point in the history